Advanced Search

Results 1 to 4 of 4

Thread: Refresh webpage automatically without clicking refresh button

  1. #1
    Join Date
    Mar 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking Refresh webpage automatically without clicking refresh button

    Hi,

    Anybody knows how to make the page refresh automatically without clicking the refresh button on IE?

    Please advice.

    Thanks.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    262
    Thanked 690 Times in 678 Posts

    Default

    This can only be done with javascript if it must be done by a command (as in with some sort of link, button, movement, etc.)
    You can use something like this:
    <img onClick="window.location('next.htm');">
    That's an example with an image, but it would work with other things as well.
    You would use the same name as the current page to refresh, rather than go to a new page.
    Maybe (not sure on this) window.location(window.location) would work to do that automatically.


    The other way to do this is with a meta refresh tag.

    This goes near the top of your head section.

    <meta http-equiv="refresh" content="3;url=http://my.com/page.htm">

    the green numerical value is the number of seconds before refeshing. This WILL refresh after 3 seconds, no matter what, with no control over this due to user interaction, etc.
    Change to 0 for immediate or any higher value for a longer pause.

    The red value is the url to which it is sent... this can be a redirect or reload.
    To make it just reload, just remove the second part, so you only have:
    content="3", without the ;url=... part.

    Remember that this will just affect the current page, so if you create a loop to the same page, the refreshing will continue forever, each X seconds. But if you link to another page, it will just stop after going there, unless, of course, that page also has a refresh on it.
    Last edited by djr33; 03-26-2007 at 09:15 AM.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    location.reload() is fine for JS.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    262
    Thanked 690 Times in 678 Posts

    Default

    Ah, good. That's easy.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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