// 移动了就更新最近一次移动的时间。
document.onmousemove = function(){
window.lastMove = new Date().getTime();
};
window.lastMove = new Date().getTime();//最近一次移动时间
window.setInterval(function(){//每1秒钟检查一次。
var now = new Date().getTime();
// 如果超时了 120秒
if( now - lastMove > 120000 ){
window.location.href='<%=request.getContextPath()%>/exit.action';
}
}, 1000);
125



被折叠的 条评论
为什么被折叠?



