Had used script to reload only part of a page. However, tested it in Firefox -> Fine, Safari -> Fine. Internet Explorer on a PC? Reloaded the image once and then stopped.
Any obvious errors?
Have ‘./code.php’ picking a random image from a MySQL database
[CODE]
<script type=”text/javascript”>
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()’,4000);
}
}
xmlHttp.open(“GET”,”./code.php”,true);
xmlHttp.send(null);
}
window.onload=function(){
setTimeout(‘Ajax()’,4000);
}
</script>
<div id=”ReloadThis”>
<?php
require(‘./code.php’);
?>
</div>