Forum Moderators: open

Message Too Old, No Replies

I don't know why this does not work

         

MrGecko

6:17 pm on Oct 31, 2007 (gmt 0)

10+ Year Member



I'm trying to make a code that will check a page to see if it changed. if it changed then the code will put the page in a div, but it is not working. it is putting the page in the div even if it has not changed.
here is the code, please see if you can help me.

function userso() {
var online = document.getElementById("online");
if (window.XMLHttpRequest) {
onlineg = new XMLHttpRequest();
} else if (window.ActiveXObject) {
isIE = true;
onlineg = new ActiveXObject("Microsoft.XMLHTTP");
}
onlineg.onreadystatechange = function() {
var onlinetext = onlineg.responseText;
if (online.innerHTML!= onlinetext) {
online.innerHTML = onlinetext;
}
};
onlineg.open("GET", "<?=$PHP_SELF?>?page=useron", true);
onlineg.send(null);
}
setInterval("userso()", 1000);

Dabrowski

7:06 pm on Oct 31, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



At a quick glance, I'd say it was the extra semi-colon:

};
<-- There

MrGecko

8:01 pm on Oct 31, 2007 (gmt 0)

10+ Year Member



That is not the problem