第一步:把以下代碼加入<body>區域中 <script>spa var Temp; var TimerId = null; var TimerRunning = false;htm Seconds = 0 Minutes = 0 Hours = 0ip function showtime() { if(Seconds >= 59) { Seconds = 0 if(Minutes >= 59) { Minutes = 0 if(Hours >= 23) { Seconds = 0 Minutes = 0 Hours = 0 } else { ++Hours } } else { ++Minutes } } else { ++Seconds }ci if(Seconds != 1) { var ss="s" } else { var ss="" } if(Minutes != 1) { var ms="s" } else { var ms="" } if(Hours != 1) { var hs="s" } else { var hs="" }get Temp = '你在本頁停留了 '+Hours+' 小時'+', '+Minutes+' 分'+', '+Seconds+' 秒'+'' window.status = Temp; TimerId = setTimeout("showtime()", 1000); TimerRunning = true; } var TimerId = null; var TimerRunning = false;it function stopClock() { if(TimerRunning) clearTimeout(TimerId); TimerRunning = false; }io function startClock() { stopClock(); showtime(); }table function stat(txt) { window.status = txt; setTimeout("erase()", 2000); } function erase() { window.status = ""; } </SCRIPT> 第二步:修改<body***>中的內容,將下面的代碼加入原<body***>中 onLoad="startClock()" |