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

Onbeforeunload handler.
Tiny question.

5+ Year Member

Msg#: 3651260 posted 7:39 pm on May 15, 2008 (gmt 0)

Hello, dear forum readers.
I`m a newbie in the JS programming, so maybe my question will look pretty stupid to you, but I will ask it anyway :-) .
IE4+ supports an "onbeforeunload" handler of "window" object. From the example shown below you may see, that confirmation box except "We really like you will stay longer" message contains also something like "Do you really want to leave this page?", etc., added by IE. Can I get rid of these addings?

<title>Onbeforeunload handle work example.</title>
function verifyClose()
{event.returnValue="We really like you and hope you will stay longer"}
<h1>Onbeforeunload event handler</h1>
<hr />
<p> Use this button to navigate to the previous page: <button id="go" onclick="history.back()">Go back </button></p>

[edited by: tedster at 8:49 pm (utc) on May 15, 2008]
[edit reason] moved from another location [/edit]


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