Refreshing the html page for regular interval time with javascript
One of my friend asked to refresh the HTML page in his project that changes the stock rates every one minutes.i gave him simple solution like
example:1
7 8 9 10 11 12 13 | <script> var timer; function refreshmypage(){ document.location=document.location.href; } timer=setTimeout(refreshmypage,60*1000); </script> |
Add above script after your HTML body content.Here setTimeout function takes two arguments one for function handler and other time to call the function,the time is in milliseconds.so i set to 60* 1000 i.e 60 seconds.
Example :2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <html> <head> <script type="text/javascript"> function load() { setTimeout("refresh()", 2000) } function refresh(){ window.location.reload() load() } </script> </head> <body onload="load()"> </body> </html> |
Above example also can be used.

I was just now looking for information about this when I discovered your blog post. I’m just visiting to say that I very much liked seeing this post, it’s very well written. Are you thinking of posting more on this? It seems like there is more material here for future posts.
Thank you,
Actually i am busy with my regular job and freelance job,even i will try to update the site in regular interval.if you have any queris you can ask here.