Sunday, July 17, 2011

Auto Refresh Page after few seconds Using Javascript


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.

0 comments:

Post a Comment

Any Questions or Suggestions ?

About

Professional & Experienced Freelance Developer From India, Technologist, Software Engineer, internet marketer and Open Sources Developer with experience in Finance, Telecoms and the Media. Contact Me for freelancing projects.

Enter your email address:

Delivered by FeedBurner