refresh big problem

Discussion in 'JavaScript' started by Jen-, Jul 22, 2007.

  1. #1
    Hello I have this code that is supposed to refresh a page, once a day. Do I need even need the setInterval in the bottom of the script? Won't it refresh once a day just based on when it gets to a certain time every day? The reason I'm asking is its too hard to test with the setInterval. Please let me know, thanks very much.


     
    Jen-, Jul 22, 2007 IP
  2. Jen-

    Jen- Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can someone please tell me why this script launches only if I enter the page during this time? It doesn't activate when the page is already open.

    ]
     
    Jen-, Jul 23, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Use:
    while (hr == 1 && mn == 1 && sc == 1) {
    setInterval('self.location.reload(true)',5000);
    }
    Code (markup):
    Instead of:
    do
    {setInterval('self.location.reload(true)',5000);}
    while (hr == 1 && mn == 1 && sc == 1)
    Code (markup):
     
    krt, Jul 23, 2007 IP
  4. Jen-

    Jen- Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks, same problem, it doesn't launch when the page is already open. It only starts if you enter the page during the time listed here or in yours above. ((hr==6)&&(mn==36)&&(sc>5)) I'm going to try something else, thanks. Solved.
     
    Jen-, Jul 23, 2007 IP