Archive

Posts Tagged ‘tips and trics’

Auto Refresh Page after few seconds Using Javascript

June 15, 2011 2 comments

Hello Friends,

Do you want to refresh your page after few second automatically? I need to auto refresh my web page after every 5 seconds 10 seconds or 1 minute. We can do this with javascript or with meta tag of html. Auto load the web page after every 10 seconds or 30 seconds using below code.

 

:Using HTML Meta Tag:
Meta HTML tag,The element provides meta-information about your page. You can include this tag inbetween tag.

Refresh Page after every 10 seconds.
<meta http-equiv=”refresh” content=”10; URL=http://www.programmingfacts.com”>

:Using Javascript:
You can also do this by using javascript setTimeout function. Just call this function in onLoad event of body tag.

Specify timeperiod in milliseconds. So if you want to refresh web page after every 5 second than timeperiod will be 5000.

 
<body onload=”javascript:setTimeout(“location.reload(true);”,timeperiod);”>

 

 

 

Thats it. I hope this may be helpful. Let me know if you find any problem.

%d bloggers like this: