B
BennyVK
Hi,
I'm not sure if this question should go to the "JavaScript" section;
but I'm open to non-JavaScript (like VBScript) options too. So, I'm
posting this here.
I have the following problem:
For my application, I need to ask a confirmation when the user closes
the browser-window. If the answer is positive, I would like to log-off
the session and close the window. If the answer is negative, I would
like to stay back (no logging-off, no closing the window).
I can't do this in the window.unload event because the window is
already closed when the unload event is fired. I tried doing this in
the beforeUnload event. But the beforeUnload event gets called even
when I refresh the page and in that case, I don't want to ask this
question or logoff.
Can somebody help me in the above scenario? Please...
Thanks,
Benny Varghese
I'm not sure if this question should go to the "JavaScript" section;
but I'm open to non-JavaScript (like VBScript) options too. So, I'm
posting this here.
I have the following problem:
For my application, I need to ask a confirmation when the user closes
the browser-window. If the answer is positive, I would like to log-off
the session and close the window. If the answer is negative, I would
like to stay back (no logging-off, no closing the window).
I can't do this in the window.unload event because the window is
already closed when the unload event is fired. I tried doing this in
the beforeUnload event. But the beforeUnload event gets called even
when I refresh the page and in that case, I don't want to ask this
question or logoff.
Can somebody help me in the above scenario? Please...
Thanks,
Benny Varghese