zeccaman
04-12-2006, 09:29 AM
Hi, I have a simple script which execute simple code when a user close the webpage he is visiting. This is the code.
<SCRIPT FOR=window EVENT=onunload>
if(getSet()==false) location.href="logout.jsp";
</SCRIPT>
<SCRIPT>
boolean settings= false;
function set() {
settings=true;
}
function getSet() {
return settings;
}
</SCRIPT>
I put the variable setting otherwise because it always executes the code.
so, when I click the link I want it is <A HREF="page.jsp" onClick="set();"> Menu </A>
now it doesn't understand when the user closes the window! I think it is a scope variable problem.
Thank you
<SCRIPT FOR=window EVENT=onunload>
if(getSet()==false) location.href="logout.jsp";
</SCRIPT>
<SCRIPT>
boolean settings= false;
function set() {
settings=true;
}
function getSet() {
return settings;
}
</SCRIPT>
I put the variable setting otherwise because it always executes the code.
so, when I click the link I want it is <A HREF="page.jsp" onClick="set();"> Menu </A>
now it doesn't understand when the user closes the window! I think it is a scope variable problem.
Thank you