How to Add Reload Buttons, Refresh Page Links

By 3 years ago   BloggingTutorials
Tweet Share Email Share  

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="">

9 comments on “How to Add Reload Buttons, Refresh Page Links

  1. javadth says:

    does it have demo ?

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

  3. 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.

  4. 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.

  5. 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.

  6. headayet says:

    I have find here a great tips thanks

  7. Rishabh Jain says:

    Thanks for sharing this and it works for me!

  8. Chicksrock says:

    I copy/pasted the “Reload Page Button” into my website (on home page). The button is invisible and I think it automatically refreshes as my guests re-visit the website. Thank you very much for your codes and help.

Leave a Reply

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

ALL comments are moderated. No links allowed. Use real name. Only useful comments will be approved.