formatc2013 formatc2013 - 6 days ago 6
HTML Question

how can I refresh something each sec?

I 'd writen something on the screen with setinterval(), and the results are queueing on the screen. I want to refresh it every seconds and have just one on the screen at a time. Any ideas?
setInterval("display()",1000);

Answer

Use an iframe or object to load a document,

<iframe src="seconder.html"></iframe>
<object data="seconder.html"></object>

which includes a meta refresh pragma:

<!doctype html>
 <html>
  <head>
    <!--One second meta refresh--> 
    <meta http-equiv="Refresh" content="1">
  </head>
  <body>
     <!--
     ...
     ...
     -->
  </body>
 </html>

References

Comments