NN 4, IE 4
You want to have a running countdown timer showing on the page.
Countdown timers can take many forms. Look to the combination of HTML and scripts in Example 15-3 of the Discussion for inspiration for your particular timer implementation. The example application sets the turn of the new year in the user's time zone as the "zero hour" for the timer, and displays a constantly updated display of the days, hours, minutes, and seconds until that time.
An onload event handler in the page invokes the
function by way of the
<body onload="setInterval('countDown( )', 1000)">
The display is updated approximately every second because the
setInterval( ) method repeatedly invokes the
countDown( ) function until a script cancels the
The display of the timer can be in a text input field (all scriptable browsers), swappable images (IE 4 or later and NN 3 or later), or body text (IE 4 or later and NN 6 or later). This example uses swappable images because it lends itself to the most flexible page designs of the choices. But for other syntactic reasons, Navigator 4 is the minimum supported browser for this example. Figure 15-2 shows the output.
Figure 15-2. Countdown timer with swappable image
Example 15-3 shows the complete HTML document for this application, including the HTML and scripts. ...