中文(繁体)
<!-- 要完成此效果把如下程式碼加入<body>區域--> <script LANGUAGE="JavaScript"> <!-- Begin day = new Date(); miVisit = day.getTime();函數時鐘() { 今天 = 新日期(); hrNow = Today.getHours(); mnNow = Today.getMinutes(); scNow = Today.getSeconds(); miNow = Today.getTime(); if (hrNow == 0) { 小時 = 12; ap =「上午」; } else if(hrNow <= 11) { ap = "AM";小時 = hrNow; } else if(hrNow == 12) { ap = " PM";小時 = 12; } else if (hrNow >= 13) { 小時 = (hrNow - 12); ap =「下午」; } if (hrNow >= 13) { 小時 = hrNow - 12; } if (mnNow <= 9) { min = "0" + mnNow; } else (min = mnNow) if (scNow <= 9) { secs = "0" + scNow; } else { 秒 = scNow; } 時間 = 小時 + ":" + 分 + ":" + 秒 + ap; document.form.button.value = 時間; self.status = 時間; setTimeout('時鐘()', 1000); } 函數 timeInfo() { milliSince = miNow; milliNow = miNow - miVisit; secsVisit = Math.round(milliNow / 1000); minsVisit = Math.round((milliNow / 1000) / 60); alert("歡迎光臨downcodes.comnn本站網域:http://www.downcodes.comnn" + "你已經在本頁停留了" + minsVisit + "分" + secsVisit + “秒”+“”); } document.write("<center><form name="form">" + "<input type=button value="Click for info!"" + " name=button onClick="timeInfo() "></form></center>"); onError = null;鐘(); // 結束 --> </腳本>