Which event is appropriate....

N

Nelson

Here is the discussion that is already discussed that I am looking for.
After visiting the link below I am getting the following code.
My question is in which client side script event I can set the value of x =
10. Setting x = 10 in the onmousemove may be a performance issue.
Thank you very much for your advice.

After certain seconds. Triggers the alert message
<HTML><HEAD><TITLE></TITLE>
<SCRIPT LANGUAGE="Javascript"><!--
var x = 10
var y = 1
function startClock(){
x = x-y
document.frm.clock.value = x
setTimeout("startClock()", 1000)
//if(x==0){
//alert("BOOM");
//x=10;
//Redirect the user to login page since the session times out
}
}
//--></SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFFF" onLoad="startClock()">
This page will explode in
<FORM NAME="frm">
<INPUT TYPE="TEXT" NAME="clock" SIZE=4 >
</FORM>
seconds...
</BODY></HTML>
 
G

Guest

The page being active or not is based on session value on the server. A page
timing out should coincide with that value, which means activity on the page
does nothing.

I assume, however, you are trying to auto log out a person who leaves a page
open. If so, you realistically have to test both mouse movement and keyboard
input. Yes, this will be a bit heavy, but not really bad, as it is all client
side. It is fairly easy to test the impact of this activity, by setting up a
do nothing JavaScript on both events.

In most cases, testing for key clicks or mouse clicks is probably enough.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
N

Nelson

"by setting up a do nothing JavaScript "
You are saying write an event handler for this event and do not write any
statement or is there any do nothig statements.
Thanks,
Nelson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top