Click to See Complete Forum and Search --> : javascript refresh script - working intermittently


Yari
05-24-2007, 02:33 AM
Hi,

I have this script, which is called from inside an iFrame to refresh the parent page.

Problem is, it only works sometimes... in Firefox and Safari it freezes or even seems to loop sometimes.

I need it to pause so I can see what's happening sometimes, and this is usefull in many other situations, hence the 'setInterval'.


<p><b>Refreshing page in 2 seconds... please wait or <a href="#Top" onMouseDown="reload()">click here</a></b></p>

<script type="text/JavaScript" language="JavaScript">
<!--
function reload() {
parent.frames.location.href = '/admin/?view=page&id=1';
}
setInterval("reload()", 2);';
//-->
</script>


Any ideas?

cgraz
05-24-2007, 05:45 AM
try this in your reload function and see if it helpstop.location.href = '/admin/?view=page&id=1';

Yari
05-24-2007, 08:22 PM
Thanks, will give it a go and let you know.

Hmmm, no, that still causes Safari to freeze. Firefox and Opera are ok.