| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | 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 |
| |
| | #3 (permalink) |
| Senior Member | can't you just use php ? witch is easy ? jw.
__________________ DirectoryPimp.com - One Pimpin' Directory! |
| |
| | #4 (permalink) | |
| NamePros Regular | 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>
Quote:
IE just doesn't seem to like updating the counter.
__________________ ask me about the internet Last edited by Jim_; 03-24-2006 at 09:08 PM. | |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |