Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

I Hate AJAX

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Jim_

Established Member
Impact
33
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.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Okay.. Post the code first thing.. And IE and firefox have some different Javascript properties which is probley the reason. (Javascript = Backend of AJAX)

- Steve
 
0
Close
can't you just use php ? witch is easy ? jw.
 
0
Close
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>

angisson said:
can't you just use php ? witch is easy ? jw.
Well, then it wouldn't be all cool and in real-time. The back-end is in PHP. Works great.

IE just doesn't seem to like updating the counter.
 
Last edited:
0
Close
kindly check activex if it's blocked or disabled on your msie it might be that one.
 
0
Close
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.
 
0
Close
but since it uses activexobject it need to update on msie. :(
 
0
Close
It was a problem with IE caching the page. All fixed now. :)
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back