Question:

HTML codes: How do I add a "click here to refresh this page" button on my webpage??

by  |  earlier

0 LIKES UnLike

I don't want the auto-refresh code.

 Tags:

   Report

4 ANSWERS


  1. This can be done...sort of.

    Put this code in between your <HEAD> </HEAD> tags: -

    <META HTTP-EQUIV="REFRESH" CONTENT="X">

    This means that the page will automatically refresh every X seconds (just change the X to suit your needs.

    However, this may not be exactly what you're looking for, and it could alse be distracting for the visitor to your Website.

    This is a better tag.  Again, put this code in between your <HEAD> </HEAD> tags: -

    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

    This would force the browser NOT to cache the page where the code has been inserted, therefore always displaying the most recently updated version.

    Hope that helps!


  2. mainframe computing-http://gotogol.info/

  3. You need to use javascript. This allows you to access the onClick event of the button, and you need to assign a javascript action to this.

    The magic is

    self.location = "thispage.htm";

    where you replace thispage.htm with the resolved url to your page. This will reload the page.

    So you end up with something like

    <FORM>

    <INPUT type="button" value="See Some Text" name="button2" onClick="self.location = 'thispage.htm'; return true">

    </FORM>

  4. <a href="JavaScript: location.reload(true);">Refresh page</a>

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

Question Stats

Latest activity: earlier.
This question has 4 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.