I have the following code:
<html>
<head>
<title>D</title>
<script type="text/javascript" src="jQuery.js">
<script type="text/javascript">
$(window).unload( function () { alert("Bye now!"); } );
</script>
</head>
<body>
<span>Hello world</span>
</body>
</html>
But this doesn’t show anything.
[Edit]
There are two things:
- I had a dummy mistake, not ending with < / script> tag. Now, it’s working on FF.
- But not chrome, as genesis told, it’s a bug!
jQuery’s
.unload()event doesn’t work in Google Chrome 14 and above. This is new reported bug. (13 days old)That is probably just a security measure from Google’s side