By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,040 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Page redirection after inactivity

P: n/a
hi all,
i am trying to implement a page re-direction after a certain amount of
inactivity. can somebody please help me in this. i was thinking could i
display a screensaver using JavaScript after some time of inactivity
and if the user moves their mouse or keyboard return to normal screen.
otherwise after certain inactivity redirect the user to a different
page.

can somebody guide me in this approach.
thanks.

Jan 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Yeah use events and a timer. Start the timer, and redirect at the end
of it, if an event occurs cancel the timer and reset it.

Jan 16 '06 #2

P: n/a
More spcifically something like:

var t
function setupTimer() [on the onload event of a browser]
{
t = setTimeout("window.loaction='[URL here]' " , [Time in milliseonds
until it goes off ex: 1000 is one second])
}

function interruptTimer() [set on the events to regerstering as
activity]
{
clearTimeout(t)
t = setTimeout("window.loaction='[URL here]' " , [Time in milliseonds
until it goes off ex: 1000 is one second])
}

I havent tested that but it gives yo a general idea.

Jan 16 '06 #3

P: n/a
cheers mate.
thanks for that. great reply. solved my problem.

Jan 17 '06 #4

P: n/a
No problem, anytime.

Jan 18 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.