In article <o_**********************@news4.tin.it>,
my****@yahoo.it
wrote:
How can I capture the unload event with javascript?
Here is an example html file. I do not recommend pestering the user
when doing an onunload. New browsers limit what can be down in the
onunload event.
Robert
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>onunload tests</title>
<script type="text/javascript">
function leaving()
{
var newWindow;
newWindow = window.open(
"http://www.yahoo.com",
"debug",
"scrollbars,resizable,location,width=700,height=50 0");
alert("please come back soon.");
}
</script>
</head>
<body onunload="leaving()">
<p>Let's pester the user when leaving our window.
</p>
</body>
</html>