0

I'm new to javascript but have managed to create the following with tidbits from the web....What I can't get done is how to get the function refresh to stop after X amount of times or X amount of time. Any help would be greatly appreciated.

<html>
<head>
<title></title>

<style type="text/css">
div.root
	{position:absolute;top:-1px;right:0px;}
</style>

<!--resize and position window-->
<script type=text/javascript>
function expand() {
	for(x = 0; x < 50; x++) {window.resizeTo(995,810);window.moveTo(0,0)}}
</script>

</head>
<body onload="expand()" style="overflow-y:hidden">

<!--refresh ackpage1 iframe-->
<script type=text/javascript>
	function refresh()
		{document.all.magic1.src = document.all.magic1.src}
		window.setInterval("refresh()",600000);
</script>

<div class='root'>
<table>
</td></tr>
<tr><td><iframe src="http://blahblahblah.html" id="magic1" name="magic1" width="990" height="800" scrolling="yes" align="right" frameborder="no" marginheight="0" marginwidth="0"></iframe></td></tr>
</table></div>
</body>
</html>
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by hielo
0

Instead of: window.setInterval("refresh()",600000); you need to save a reference to that call: timerID = window.setInterval("refresh()",600000); THEN (whenever you are ready), you use timerID to stop subsequent calls by passing that id to clearInterval. clearInterval(timerID)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.