The unload event is sent to the window element when the user navigates away from the page; by clicking on a link to leave, or enter a new URL to leave, or any case...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mobile-Web-App: jQuery</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script>
$(window).unload(function ()
{ alert("Bye!");
});
</script>
</head>
<body>
<a href="http://mobile-web-app.blogspot.com/">http://mobile-web-app.blogspot.com/</a>
</body>
</html>
No comments:
Post a Comment