<script language="Javascript">
window.onload = function()
{
start = new Date().getTime();
}
window.onunload = function()
{
end = new Date().getTime();
time = (end-start)/1000;
alert("停留了 "+time+" 秒");
}
</script>
window.onload = function()
{
start = new Date().getTime();
}
window.onunload = function()
{
end = new Date().getTime();
time = (end-start)/1000;
alert("停留了 "+time+" 秒");
}
</script>
如果在本页面有提交操作,提交后还是在该页面,有没有什么办法呢
在onload里加一个判断,如果值为空,则加载,否则不加载。