How to Add Reload Buttons, Refresh Page Links

Sometimes you  want to add a refresh page or reload page link to your web page. This might be for purposes when you are live blogging, posting newsy contents in real time or engaging in a quick discussion on quick blogging themes.

Javascript Refresh Link



The easiest way would seem to link to the permalink of the page, and clicking it will simply revisit the page again. But then the next methods are independent of links added to the code.

The simplest way is to use a javascript link and it looks like this. This will create a link and clicking it will simply reload the page of the current url as visible in the browser url field.

<a href="javascript:location.reload();" >RELOAD PAGE</a>

Javascript Reload Button

If you prefer to display this code as button, use the input tags and a button will appear instead of a link.

<input type="button" value="Reload page" onclick="location.reload();"> 

Its easy to add classes to style the links and buttons as per your site design. Just add CSS style to the class ‘yourstyle’ and get an amazing number of options.

<a class="yourstyle" href="javascript:location.reload();" >RELOAD PAGE</a>

Reload Page Button

If you do not want to add the scripts in the html body, then another way is to put the script in the HEAD of the html code like this

function reloadPage()

The use of input tags create the buttons as needed. Click to refresh the page.

<input type="button" value="Reload page" onclick="reloadPage()">

Auto Refresh Web Pages

Use this with care as such pages will continue to autorefresh is left alone in a browser window and can affect page traffic statistics.

You can force reloading of pages after selected time intervals using META refresh tags. In the example below, the page will refresh every 30 seconds.

<META HTTP-EQUIV="refresh" CONTENT="30">

If the url is fixed, the you can add the urls link also to the page

<META HTTP-EQUIV="refresh" CONTENT="30" URL="">

  1. javadth says:

    does it have demo ?

  2. P. Chandra says:

    Added the demo links and buttons to the post.

  3. I read your post,it’s really helpful to us. I think it,s working for my site.Thank you.

  4. siya sinha says:

    Thanks for providing good information to me and professional user. I do not much know about java script, but i will try it and want to learn it.

  5. suman singh says:

    Very nice topic sharing with us, I would like to thanks you for sharing newest topic about java script. This topic is very helpful to me and other it professional.

  6. Sharad says:

    Thanks for the sharing awesome post, it is very helpful to me it’s a good for starting thanks for the tips, keep it up I am waiting for your next stuff.

  7. Vivek Shukla says:

    Really good article to understand JS. i am trying to add reload button in my web page but some error occurs.thanks for providing some script to add button.

  8. Sharik says:

    Thanks for the sharing good information, this topic is very helpful to me and other it person, keep it up i waiting your next stuff.

  9. Eashan says:

    it is awesome post sharing,it’s helpful to us i am trying to add reload button in my website,thanks again keep it up.

  10. headayet says:

    I have find here a great tips thanks

  11. Rishabh Jain says:

    Thanks for sharing this and it works for me!

Leave a Reply

Your email address will not be published. Required fields are marked *

Share This

Recommended for You