contra10 Posted March 25, 2009 Share Posted March 25, 2009 I was told that I should use javascript to create a live countdown timer and then send information when the timer is finish send the information using php. The question is basically how should i go about creating a timer with javascript? Quote Link to comment Share on other sites More sharing options...
Floydian Posted March 25, 2009 Share Posted March 25, 2009 setInterval('code to eval....', milliseconds); That function works like eval, executing the string as if it were js. And the milliseconds is the delay time between intervals. Once you set that, it will keep on running. To cancel it, you'd have to store the returned value from setInterval in a variable and call clearInterval var timer = setInterval('code to eval....', milliseconds); clearInterval(timer); Hope that helps... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.