| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Aug 2005 Location: NY, USA
Posts: 610
![]() ![]() ![]() ![]() ![]() ![]() | I Hate AJAX I'm working on a real-time users online counter. It works fine in Firefox. It won't update properly in IE. http://www.j-fx.ws/online/ Any ideas I hate this.
__________________ ask me about the internet |
| |
| | THREAD STARTER #4 (permalink) | ||||
| NamePros Regular Join Date: Aug 2005 Location: NY, USA
Posts: 610
![]() ![]() ![]() ![]() ![]() ![]() | Code: <div id="online"> </div>
<script type="text/javascript" language="javascript">
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
function callServer(url) {
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);
}
function updatePage() {
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
document.getElementById("online").innerHTML = response;
setTimeout('callServer("online.php");',2000);
}
}
callServer("online.php");
</script>
????: NamePros.com http://www.namepros.com/programming/180273-i-hate-ajax.html IE just doesn't seem to like updating the counter.
__________________ ask me about the internet
Last edited by Jim_; 03-24-2006 at 10:08 PM.
| ||||
| |
| | THREAD STARTER #6 (permalink) |
| NamePros Regular Join Date: Aug 2005 Location: NY, USA
Posts: 610
![]() ![]() ![]() ![]() ![]() ![]() | Nope. That's not it. It loads fine once in IE, but it doesn't update. It seems the setTimeout function is being ignored or something. I hate Internet Explorer.
__________________ ask me about the internet |
| |