Click to See Complete Forum and Search --> : Cant detect browser's close button is clicked


topash
05-05-2003, 06:05 AM
If user clicks the browser's close button then want to do some processing. But not able to detect the Browser's close button event. Can it be done with Javascript?

AdamGundry
05-05-2003, 07:46 AM
The closest you can get is to use onUnload (http://developer.netscape.com/docs/manuals/communicator/jsref/evnt24.htm#1012516), which will fire when the user leaves the page (via a link, typing in the address bar or closing the browser).

Adam

requestcode
05-05-2003, 09:10 AM
Unfortunately Netscape does not recognize that event when you close the window using the "X" close button. IE does have the onbeforeunload event that might work for you, but again it is not supported by Netscape.