Help on onbeforeunload event to alert on close of window(X)

R

RJN

Hi

I have a pop-up window which has a task menu on its left which are
nothing but links to different screens. This window also has a close
button. On click of close button I do some server side operation and the
window closes itself. Now the user can close the window by clicking on
X(Top right corner) or by pressing Alt+F4 window. I want to atleast
alert the user when he does these 2 things to inform he has not clicked
on the close button. I tried using onbeforeunload event. The problem
with this event is it gets fired whenever the user navigates to a
different url by using the task menu. Any help is highly appreciated as
it has become critical now.

Regards

RJN
 
B

bruce barker

you are on the right track, there is no browser close event, only page
unload (which happens on a navigation or postback). all valid submits
(postbacks) should disable your unload event handler.

-- bruce (sqlwork.com)
 

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

No members online now.

Forum statistics

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

Latest Threads

Top