How to Create a Countdown Timer with Javascript

This video demonstrates how to build a countdown timer with the setInterval function in Javascript, a text field, and jQuery to update your text field.

Download 70.8 MB
Download (iPhone & iPod) 40.6 MB

{ 9 comments… read them below or add one }

rsludge December 15, 2010 at 9:58 am

seems you’re not as experienced in Javascript as in Ruby :)
but screencast is nice

Reply

rsludge December 15, 2010 at 9:58 am

seems you’re not as experienced in Javascript as in Ruby :)
but screencast is nice

Reply

Charles Max Wood December 24, 2010 at 9:15 pm

I’m glad you like the screencast.

No, I’m not as experienced in Javascript, but I’m working on that. If you have any resources you particularly like for learning Javascript, I’d love to see them.

I’m proficient, but not an expert in Javascript.

Reply

Charles Max Wood December 24, 2010 at 9:15 pm

I’m glad you like the screencast.

No, I’m not as experienced in Javascript, but I’m working on that. If you have any resources you particularly like for learning Javascript, I’d love to see them.

I’m proficient, but not an expert in Javascript.

Reply

Adrian8061 September 21, 2011 at 10:50 pm

Cool and sweet, since I am learning.

Reply

Ragalap99 November 20, 2011 at 2:17 pm

hi sir,
                    i dont no how to connect by javascript through database

Reply

Remi June 14, 2012 at 11:18 am

I want to use this code in a query from wordpress. And i want to show it multiple times, any idea’s how to?

Reply

Mark July 27, 2012 at 7:54 pm

Can  internet lag from a persons computer to the primary server (Bid Timer), then back to the persons computer (Bid Timer) be eliminated. I hear that some people are not seeing the correct countdown time on their computer subsequently causing their Bid Strategy to be off. Some people say that occasionally their view of the timer goes from 2 seconds to Sold. Not everyone has this problem. Any explanations?

Reply

Charles Max Wood July 28, 2012 at 8:53 pm

Mark-

That’s definitely an issue. There will always be some lag between the server and client. So, if I ask what time it is or how long the timer has left, the information I get back from the server is as old as the response is on the server. So, if there’s a 300ms delay between the server sending the response and the client receiving the response, then the timer will end 300ms late.

There may be some clever ways to figure out what the delay (approximately) is and account for it, but I’m just not sure.

Has e-bay solved this problem? 

Thanks,
Chuck

Reply

Leave a Comment

{ 1 trackback }