Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing the main Frame every 60 seconds.

Status
Not open for further replies.

randy4126

Programmer
Jun 2, 2001
62
US
I am trying to refresh the main frame of a page with three frames every 60 seconds. This is what my index.html looks like.

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Frameset//EN&quot; &quot;<html>
<head>
<title>TWC VOD Monitoring Tool</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>

<script language=&quot;JavaScript&quot;>

function refreshPage()
{
while(1)
{
parent.main.history.go(0);
sleep(60);
}
}
</script>
</head>
<meta http-equiv=&quot;Refresh&quot; content=&quot;5;url=javascript:refreshPage()&quot;>
<frameset rows=&quot;76,*&quot; cols=&quot;*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;>
<frame src=&quot;topframe.html&quot; name=&quot;topFrame&quot; scrolling=&quot;NO&quot; noresize >
<frameset rows=&quot;*&quot; cols=&quot;161,*&quot; framespacing=&quot;0&quot; frameborder=&quot;NO&quot; border=&quot;0&quot;>
<frame src=&quot;leftFrame1.html&quot; name=&quot;leftFrame&quot; scrolling=&quot;NO&quot; noresize>
<frame src=&quot;Homepage?style=styles/Homepage.xsl&dtdName=Homepage.dtd&docType=Homepage&quot; name=&quot;main&quot;>
</frameset>
</frameset>

<noframes>
<body bgcolor=&quot;#eeeedf&quot;>
</body></noframes>
</html>
</html>

Every time I try to delay the next refresh of the page it causes my processor on the client machine to be used at 100%. Thanks for any help you can give me.

Randy
smiletiniest.gif


You can Email me at: RCooper@cinci.rr.com
 
Personally, I'd do the refresh in &quot;main&quot;:
Code:
   <script type=&quot;text/javascript&quot; language=&quot;JavaScript&quot;>
      function refreshThis() {
         history.go(0);
         return;
      }
      function onPageLoad() {
          window.setTimeout(&quot;refreshThis();&quot;, 1000);
          return;
      }
   </script>
   <body onload=&quot;onPageLoad();&quot;>
      ...
   </body>
What you're doing is running the script all the time (the [tt]sleep(60);[/tt] doesn't deactivate your script). The above only gets fired every 60 seconds and won't swamp you processor.

________________________________________
[hippy]Roger J Coult; Grimsby, UK
In the game of life the dice have an odd number of sides.
 
Is there a way to do this from the frames html? I want the page they currently have up to be refreshed every 60 seconds. This is currrently a system monitoring tool and the sub pages on this web site need to updated too. Most of this pages are XMl with style sheets so I thought it would be easiest to do it from the frames html.

Randy
smiletiniest.gif


You can Email me at: RCooper@cinci.rr.com
 
Actually I did get this to work on the style sheet. Thanks for you help.

Randy
smiletiniest.gif


You can Email me at: RCooper@cinci.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top