Results 1 to 2 of 2

Thread: Unable to refresh page with delay using java script in address bar

  1. #1
    Join Date
    Oct 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Unable to refresh page with delay using java script in address bar

    Hi all,

    i started learning java script recently....Please help me to learn it.....

    Problem:

    I am trying to refresh a page for every 30 mins by running java script in the address bar....

    But unfrotunately it is working just once and getting aborted....

    Code:
    javascript: for(i=1;i<100;i++){setTimeout(location.reload(true),3000);}
    Thanks in advance...

    Regards
    Prasad

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Every time the page is refreshed, all pending intervals and timeouts are effectively canceled. This is because, once the page reloads, nothing in javascript is carried forward.

    So this cannot be done in the address bar. But if you have access to the pages code, you could see to it that upon each page load a timeout for a reload in 3 seconds was set.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •