March 25th, 2003, 11:33 PM
-
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
March 25th, 2003, 11:42 PM
-
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.
March 25th, 2003, 11:45 PM
-
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.