Refreshing a Web Page after every N seconds.

Rajesh_Kumar
Posted by Rajesh_Kumar under JavaScript category on | Points: 40 | Views : 693
<script type="text/JavaScript">
function page_refresh_in_every_N_seconds(no_of_seconds)
{
setTimeout("location.reload(true);",no_of_seconds);
}
</script>


//Call above function in Body OnLoad event as:
<body onload="JavaScript:page_refresh_in_every_N_seconds(10000);">


Now,the page will refresh in every 10 seconds.

Note:10000 milliseconds = 10 second

Comments or Responses

Posted by: Learningtorise on: 2/19/2014 Level:Starter | Status: [Member] | Points: 10
Hey, I tried refreshing page,
My Test Url:
http://www.EYIndiaTest.com/#stats
changed to:
http://www.EYIndiaTest.com

How can i avoid this?

Login to post response