Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    May 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatically refresh page

    Does anyone have HTML code to automatically refresh a web-page? I'm looking for code to updated a page that may be cached after I've made modifications to it. (In particular, a page containing price information).

    I need something that will work on all browsers, preferably. I've looked at the Refresh metatag, but that seems only to redirect you from one page to another, and I want to refresh the current page.

    Thanks for help

  2. #2
    navir
    Guest

    Re: Automatically refresh page

    Hi, Lyn:

    You already know the answer: Use the http-equiv attribute of the meta element to redirect to the SAME page. For example, if your page is filename.htm, then

    <meta http-equiv="refresh" content="60; url='filename.htm'">

    will reload the page filename.htm every 60 seconds.

    Depending on how fast you can type, try this experiment:

    Create a page (redirect_test.htm) with the following markup:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>redirect test</title>
    <meta http-equiv="refresh" content="60; url='redirect_test.htm'">
    </head>

    <body bgcolor="yellow">

    </body>
    </html>

    Open the page in Notepad, and in your browser. Quickly (within 60 seconds) change the markup in the file displayed in Notepad from <body bgcolor="yellow"> to <body bgcolor="red">. Then save the modified file (before the 60 seconds expire).

    When 60 seconds expire, the page background will change from yellow to red. You can try this as many times as you want using values such as blue, aqua, black, and so on.

    Regards,
    Ivan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •