Event Close Browser botton "X" - JavaScript

Hello Every Body,

I would like to know if I can catch the closing event of the browser (button “X”) and keep it from closing using JavaScript, and if is possible, to know the code or some link about this code.

I am thinking about JavaScript but if you know other language, it will help me a lot as well.

Thanks. Claudia

Subject: Event Close Browser botton “X” - JavaScript

IE has the event OnUnload, it will not stop the window closing, but it will allow you to catch the event. Search Google for javascript onunload

for more info.

Subject: RE: Event Close Browser botton “X” - JavaScript

The onUnload event is fired when the user closes the browser. You can pop-up other windows in this event (an annoying feature to say the least). I don’t think it’s possible to cancel the event as you can with some of the LotusScript events.

If it could be accomplished consider the possibilities: you visit a webpage (accidently or on purpose) and not only do you get bombarded with popups when you try to leave, but you can close the original page either! Eeek! (I realize you wouldn’t do this, but if it were possible, I’m sure other less scrupulous designers would have already taken advantage of it!)