#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    1
    Rep Power
    0

    Javascript Question - Need Help


    I'm very new to all of this, so please bear with me. I have built a Java Script with the help of some friends that allows me to have a series of countdown timers on a web page. The counters work great as long as you don't close the web page at all. As soon as you refresh or close the page and come back, all of the counters are reset to zero again which defeats the purpose of the counters. I thought that perhaps all I needed to do would be to host the page on my network, so I set up a web server on my laptop, but that still doesn't resolve the issue. I know there is probably a line of code that I simply need to add to tell the script to keep running after the page is closed, I just don't know what that line is.

    The sample code is here: (I have it on my laptop as well as hosted by my ISP for test purposes.)

    http://mywebpages.comcast.net/bumlak/spawntimer

    Any help would be GREATLY appreciated.

    Erich
  2. #2
  3. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,958
    Rep Power
    4035
    Well, the way javascript works means that it doesn't presit across pages. You could try and use cookies to store the information, but it's not the eaisest thing to do. With just one timer it wouldn't be too hard, but with multiple timers it adds to the dificulty.
  4. #3
  5. No Profile Picture
    Got source?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2003
    Location
    Laguna Niguel, California, USA
    Posts
    2,331
    Rep Power
    14
    If I'm correct, what you want to happen is the counter to continue its time after you close the browser window and resume when you open it again. This is impossible with javascript, since it runs on client machines and requires an open browser to work.

IMN logo majestic logo threadwatch logo seochat tools logo