English
<!--要完成此效果把如下代码加入到<body>区域中--> <script LANGUAGE="JavaScript"> <!-- Begin day = new Date(); miVisit = day.getTime(); function clock() { today = new Date(); hrNow = today.getHours(); mnNow = today.getMinutes(); scNow = today.getSeconds(); miNow = today.getTime(); if (hrNow == 0) { hour = 12; ap = " AM"; } else if(hrNow <= 11) { ap = " AM"; hour = hrNow; } else if(hrNow == 12) { ap = " PM"; hour = 12; } else if (hrNow >= 13) { hour = (hrNow - 12); ap = " PM"; } if (hrNow >= 13) { hour = hrNow - 12; } if (mnNow <= 9) { min = "0" + mnNow; } else (min = mnNow) if (scNow <= 9) { secs = "0" + scNow; } else { secs = scNow; } time = hour + ":" + min + ":" + secs + ap; document.form.button.value = time; self.status = time; setTimeout('clock()', 1000); } function 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; clock(); // End --> </script>