Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Onbeforeunload handler.

Tiny question.

7:39 pm on May 15, 2008 (gmt 0)

New User

5+ Year Member

joined:May 15, 2008
votes: 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]