Welcome to WebmasterWorld Guest from 54.158.51.150

Forum Moderators: open

Message Too Old, No Replies

Onbeforeunload handler.

Tiny question.

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

5+ Year Member



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?

<html>
<head>
<title>Onbeforeunload handle work example.</title>
<script>
function verifyClose()
{event.returnValue="We really like you and hope you will stay longer"}
window.onbeforeunload=verifyClose;
</script>
</head>
<body>
<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>
</body>
</html>

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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month