I used this code HERE to make my div auto refresh. In Firefox it works like a charm. Unfortunately like the thread says 'It doesn't work', so they were probably trying it in IE, whatever flavour. I put it in my page and wouldn't you know, it doesn't work in IE but does in FF. Does anyone know why?
function Ajax(){
var xmlHttp;
try{
xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("No AJAX!?");
return false;
}
}
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
document.getElementById('ReloadThis').innerHTML=xmlHttp.responseText;
setTimeout('Ajax()',1);
}
}
xmlHttp.open("GET","stats.php",true);
xmlHttp.send(null);
}
window.onload=function(){
setTimeout('Ajax()',1000);
}
It works up to point as it pulls the info from the 'stats.php' page but only once. How can I get IE to keep 'looping'? Any help would be very much appreciated.