Saturday, February 11, 2012

jQuery: unload event

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...
jQuery: unload event
<!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