dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Script Request/Help

  1. #1
    Join Date
    May 2011
    Posts
    5

    Script Request/Help

    Does anyone know of any script that is basically a looping stopwatch that continues to run server side even if you close the web page & go back? Been googling around but all i can find are ones that you load page up, click start & if you refresh page its reset & I need a continuous running timer that counts down to 0 & then starts counting down again.

    Anyone got any idea's where I can find one?

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,968
    You would use a cookie to store the information in to client side.

    You would need to store a reference to when the stopwatch / timer was started, a reference to the time when the page was closed and a reference to when the timer is to be considered lapsed and or ended.

    So each load of the page would result in the cookie being loaded, the existing data deleted (as in delete the cookie) then on page close set a new cookie with the above information.

    All you need to do is google setting and deleting and reading cookies, how to run a function on web page close and your timer / stop watch.

    OK?
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles