How to Create a Countdown Timer with Javascript

by Charles Max Wood on November 30, 2010

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

  • Pingback: Flash Countdown Timer - Wordpress 201

  • http://rsludge.myopenid.com/ rsludge

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

  • http://rsludge.myopenid.com/ rsludge

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

  • http://teachmetocode.com Charles Max Wood

    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.

  • http://teachmetocode.com Charles Max Wood

    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.

  • Adrian8061

    Cool and sweet, since I am learning.

  • Ragalap99

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

  • Remi

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

  • Mark

    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?

    • http://teachmetocode.com Charles Max Wood

      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

Previous post:

Next post: