refresh page with timing (every 60 seconds)

Discussion in 'JavaScript' started by Namuk, Jul 7, 2008.

  1. #1
    heloo everyone...

    i have a problem about my site.. i want to refresh my page every 60 seconds. so how do i can do that...
    i can refresh that by clicking the "refresh this page"...

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

    but i don't know how to set the time... anyone can help....please,,,,

    thanks....
     
    Namuk, Jul 7, 2008 IP
  2. pflunk

    pflunk Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Put this somewhere on your page...


    <script type="text/javascript">
    setTimeout("location.reload(true)")
    </script>

    BTW.
    You could use instead:
    setTimeout("location=location")
    which is a bit funnier but still works.
     
    pflunk, Jul 7, 2008 IP
  3. koolman

    koolman Peon

    Messages:
    76
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    koolman, Jul 7, 2008 IP
  4. Namuk

    Namuk Peon

    Messages:
    49
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks... i got it....
     
    Namuk, Jul 7, 2008 IP
  5. kceleb9

    kceleb9 Peon

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You will need to set a time out each time the page loads.

    use something like:

    onload=init();

    function init()
    {
    setTimeout(fucntion() {
    document.location = document.location.href;
    },1000);
    }

    Adjust the length of the timeout to suit your needs.
     
    kceleb9, Jul 8, 2008 IP