Home > JavaScript, tips & trics > Auto Refresh Page after few seconds Using Javascript

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.

  1. javascript forum
    August 7, 2012 at 6:22 am

    Awesome things here. I’m very glad to see your article. Thanks a lot and I’m looking ahead to contact you.
    Will you please drop me a mail?

  2. bonecancerradiation.webnode.com
    September 14, 2013 at 10:55 am

    Since there are so many differenmt types of feline cancer,
    there are a number of diagnostic tools and tests that may be
    necessary tto confirm and identify a particular case of
    this disease. There are two majkr reasons behind the bone cancer pain.
    And sometimes children who have Neuroblastoma Stage 4 cancers
    will have to get a blood stem transplant.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: