Realtime Countdown v1.1


©2006 Nathan Bolender
www.nathanbolender.com

countdown( str element, str date [, int mode [, str name]] )

This function will generate and print the information for your countdown into the element chosen. It will update every second, formatting it correctly every time.

Date must be a properly formatted string. Examples of valid date string are as follows: The possible modes are:

Also, in order to load a countdown you must call the function, and then it will update on its own. I reccomend making a function called load() and adding that to the body onload attribute. An example of a load() function is below:

<script language="javascript" type="text/javascript">
function load() {
countdown('time', "September 19, 2006 0:00:00", 2, 'Talk Like a Pirate Day');
countdown('clock', "October 31, 2006 0:00:00", 1, 'Halloween');

}
</script>

Examples