BlueIshDan
☠
- Local time
- Today, 18:09
- Joined
- May 15, 2014
- Messages
- 1,122
Though I have some intellectual understanding of programming and the computer, I have more of an intuitive understanding of how everything works together.
I was wondering why, in many languages, this works:
NOW this works sometimes. I was wondering if anyone could explain to me when and why it does and doesn't work.
Feed my brain please!
FYI here is another, more in depth, example:
Thanks!
Dan
I was wondering why, in many languages, this works:
Code:
if (object) {
}
NOW this works sometimes. I was wondering if anyone could explain to me when and why it does and doesn't work.
Feed my brain please!
FYI here is another, more in depth, example:
Code:
[B][COLOR="Red"][FONT="Arial Black"] DECLARATION [/FONT][/COLOR][/B]
var XMLHTTPRequestObject = false;
[B][COLOR="Red"][FONT="Arial Black"] INIT [/FONT][/COLOR][/B]
if (window.XMLHttpRequest) {
XMLHTTPRequestObject = new XMLHttpRequest;
} else {
XMLHTTPRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}
function getData(dataSource, divID) {
[B][COLOR="Red"][FONT="Arial Black"] QUESTION [/FONT][/COLOR][/B]
if (XMLHttpRequestObject) {
var obj = document.getElementById(divID);
XMLHTTPRequestObject.open("GET", datasource);
XMLHTTPRequestObject.onreadystatechange = function () {
if (XMLHTTPRequestObject.readystate == 4 && XMLHTTPRequestObject.status == 200) {
obj.innerHTML = XMLHTTPRequestObject.responseText;
}
}
XMLHTTPRequestObject.send(null);
}
}
Thanks!
Dan