这段程序放在<body>与</body>之间 <script language="Javascript"> <!-- pageOpen = new Date(); function stay() { pageClose = new Date(); minutes = (pageClose.getMinutes() - pageOpen.getMinutes()); seconds = (pageClose.getSeconds() - pageOpen.getSeconds()); time = (seconds + (minutes * 60)); time = (time + " 秒钟"); alert("您在这儿停留了" + time + ".欢迎下次再来!"); } //--> </script>
这段程序放在<body ****>正文中 onUnload=stay()
|