|
Q1563 How can I redirect to another page if there is no activity by the user for a certain amount of time?
irt.org | Knowledge Base | JavaScript | Timeout | Q1563 [ previous next ]
Q1563 How can I redirect to another page if there is no activity by the user for a certain amount of time?
Try:
<html>
<head>
<script language="JavaScript"><!--
if (document.layers) {
window.captureEvents(Event.MOUSEMOVE);
}
window.onMouseMove = resetTimer;
var tID = '';
function resetTimer(e) {
alert('here');
clearTimeout(tID); // reset the timer
tID = setTimeout('executeTimer()',10000);
}
function executeTimer() {
location.href = 'a.html';
}
//--></script>
</head>
<body onLoad="tID = setTimeout('executeTimer()',10000)" onMouseMove="resetTimer()">
...
</body>
</html>
|
Feedback on 'Q1563 How can I redirect to another page if there is no activity by the user for a certain amount of time?'
|
|
Copyright © 1996-2009 irt.org, All Rights Reserved.