Hi,
Sometime ago I was working on a script that continually refreshed the browser if the connection was lost with the server. The help I received was great and I thank all those people who took the time to lend a hand.
I have now got the same issue with a slight difference, the script below refreshed an iFrame which works fine.
My question is can this script be made to work on a normal web page (without an iFrame).
[code]
<script type=’text/javascript’>
(function ( img, ifId, wait, notify )
{
var iObj = new Image(),
theIframe = document.getElementById( ifId ),
ifHref = theIframe.contentWindow.location.href;
iObj.onerror = function()
{
dt( ‘Attempting iframe reload @ ‘ + new Date().getTime() );
try{ theIframe.contentWindow.location.href = ifHref; }catch( e ){ dt( ‘Access Error ‘ + new Date().getTime() ); };
setTimeout( test, wait );
}
iObj.onload = function()
{
dt( ‘Load OK’ );
setTimeout( test, wait );
}
function test()
{
try{ ifHref = theIframe.contentWindow.location.href; }catch( e ){};
iObj.src = img + ‘?t=’ + new Date().getTime();
}
function dt(s){ if(notify)document.title = s;}
test();
})( ‘myimage.gif’, ‘if1’, 2000, true );
</script>
Many thanks if you can spare the time to help.