I have a situation where I need to stop a window from closing and display a confirmation box before I allow the entire application to close by using either a self.close() link or the x in the browser. The problem is I cant have this popup when the page is just being refreshed by the user. right now to do this I am using: var strMsg = "This action will close the entire application."; window.event.returnValue=strMsg; in the onbeforeunload event. Any help would be great!!!
the event you mentioned (onbefore...) only works in IE. There is no way to detect when the browser is refreshed or closed. Eric
posted 16 years ago
This is for an intranet, so it is an IE only gig. Let me explain my situation and maybe a better solution will present itself. I have an application that will launch with a main window and anywhere from 0 to n child windows will also be loaded. This application is for non-web savvy people, so the first thing that is needed is a confirmation box to ask if a person really wants the main page to close. The second thing is, if yes log the person out, close all child windows, and then close the main window. Else if no, then leave everything open and the user logged in. Hopefully this will spawn some ideas. Thanks
I have nothing more to add.
A feeble attempt to tell you about our stuff that makes us money