-
JS: Close event
I have this script that suppose to be the alert pop up when you close the page but when I refresh the page 'F5' the alert pop up. What's wrong w/ this? Is there another way to do this? Just pop up an alert when you try to close the page?
Code:
<html>
<head>
<title>sample</title></head>
<body onbeforeunload="alert('closing');">
</body>
</html>
-
Re: JS: Close event
When you refresh, you're closing the page; that is expected behaviour.
-
Re: JS: Close event
Humm, was it possible in JavaScript to see where the user is browsing to? (I'm on GPRS right now so googling is a pain.)