117、退出显示停留时间

117、退出显示停留时间

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT LANGUAGE="Javascript">

<!-- Begin

pageOpen = new Date();

function bye() {

pageClose = new Date();

minutes = (pageClose.getMinutes() - pageOpen.getMinutes());

seconds = (pageClose.getSeconds() - pageOpen.getSeconds());

time = (seconds + (minutes * 60));

if (time == 1) {

time = (time + " ");

}

else {

time = (time + " ");

   }

alert('你在本页呆了 ' + time + '.  下次可要多呆一会吧,再见!');

}

// End -->

</SCRIPT>

 

 

第二步:把<body>中的内容改为:

<body bgColor=#fef4d9  OnUnload="bye()">

 

Write a comment

Comments: 0