Personal computing discussed

Moderators: SecretSquirrel, just brew it!

Topic Author
Posts: 13
Joined: Mon Feb 09, 2004 3:07 am

ASP help needed!

Tue Sep 07, 2004 5:21 am


I have written an ASP application do display information from an Access database - works fine!

I have created a login page but now want to be able to track when a user closes the IE browser window using the X button (top right). I have managed to come up with some code to do this using the onbeforeunload value in the <BODY> tag of my pages. This calls a javascript function to display a popup page called killsession.htm informing the user that the session has terminated.

However, I don't want this popup to occur for ANY other button pressed including the Back button!

The problem may be here:
 if (event.clientY < 0)

Could anyway suggest why my function fires every time the Back button is pressed and suggest a fix so that ONLY the X button (or Alt-F4) will call this function? There must be some final signal that can be traced just as an IE browser window is closing?


function killXSession() { 
if (event.clientY < 0) {
x = screen.availWidth / 2 - 200;
y = screen.availHeight / 2 - 50;
killsessionWin ="killsession.htm", "killsession",
"left=" + x + ",top=" + y +
",height=125,width=400,fullscreen=no,toolbar=no," +
"status=no,menubar=no,scrollbars=no,resizable=no," +

Who is online

Users browsing this forum: No registered users and 2 guests