You need to download digits1.zip, un-zip it and upload the contents to your internet directory.
| <SCRIPT>
// assign an HTML
string to the variable colon, this makes it easier to read code later on // create the
initial HTML images & names so that they can be used by JavaScript
later on function upDate(){ var ampm = "am"; // am or pm? // since hours go from 0 - 23 the hours need to be converted if (hours >= 12) { ampm = "pm"; hours = hours - 12; } // if hour = 0 then convert to 12, // NOTE: also takes care of the above situation where hours = hours - 12 if (hours == 0) hours = 12; // if less then 10 we need the "0" placeholder for hours if (hours < 10) hours = "0" + hours; else hours = hours + ''; // if less then 10 we need the "0" placeholder for minutes if (minutes < 10) minutes = "0" + minutes; else minutes = minutes + ''; // if less then 10 we need the "0" placeholder for seconds if (seconds < 10) seconds = "0" + seconds; else seconds = seconds + ''; // swap out the old images with the "new images" (the new time) document.images['h0'].src = "digits/" + hours.charAt(0) + ".gif"; document.images['h1'].src = "digits/" + hours.charAt(1) + ".gif"; document.images['m0'].src = "digits/" + minutes.charAt(0) + ".gif"; document.images['m1'].src = "digits/" + minutes.charAt(1) + ".gif"; document.images['s0'].src = "digits/" + seconds.charAt(0) + ".gif"; document.images['s1'].src = "digits/" + seconds.charAt(1) + ".gif"; document.images['tod'].src = "digits/" + ampm + ".gif"; // the window method setTimeout() causes upDate() to run, // only after waiting 1000 milliseconds or one second // since this call itself is in inside the upDate() it causes upDate to run every sec // -- hences making the "time" dynamic setTimeout("upDate()", 1000); } </ SCRIPT>after "everything" is loaded into memory |