homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

JavaScript ONUNLOAD event
Trying to make a 'smart' uncloseable window...

 9:45 pm on Apr 4, 2002 (gmt 0)

Hello. I am trying to use the onUnload event to create an uncloseable window. The only problem is that the event does not only trigger when the window is closed, but also when the user refreshes or navigates away from the document. I need to find a way to circumvent this, and spawn a new window if (and only if) the parent window is closed. I have tried everything from checking self.opener and setting session cookies (which apparently do not work across child windows..) Does anyone have any ideas that I might have missed?




 9:47 pm on Apr 4, 2002 (gmt 0)

the only way I have seen it done is with the onUnload event on a full size external frame. This way the navigation isn't effected but if you leave the site it triggers the onUnload.


 10:28 pm on Apr 4, 2002 (gmt 0)

Welcome to the forums.

I might have some ideas, weasel, but first send me the URL via Sticky Mail (top of the page) - so I can be sure never to visit that site ;)

Either that, or tell us why you want to overrule your visitor's wishes with such a heavy hand.


 7:04 pm on May 16, 2002 (gmt 0)

Hehehe.. Actually, it's not for subversive purposes.. It is for an internal company web page at the call center I work at.. The page contains information on particular clients, valuable resources for the employees, but some of them inevitably close the browser window. The goal is to have it re-open, but only in the event that it is closed..

To top it all off, I set up the page to refresh automatically every 10 minutes to reflect any changes I made, and as a result during my experiments some of the terminals ended up with 15 or 20 browser windows open by the end of the shift.. :)


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved