<!DOCTYPE html>
<html>
<head>
<title>jQuery unload() method</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
$(window).unload(function(){
$('div').text('unload event triggered.');
});
});
</script>
</head>
<body>
<img src="../../images/img_nat.png" width="207" height="137" />
<div>Image loaded successfully.</div>
</body>
</html>