案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/js/jquery.js"></script>
4
<script type="text/javascript">
5
$(document).ready(function(){
6
  $(window).unload(function(){
7
    alert("再见!");
8
  });
9
});
10
</script>
11
</head>
12
<body>
13
<p>当您点击 <a href="http://w3xue.com">这个链接</a> 时,或者关闭窗口,会触发一个警告框。</p>
14
</body>
15
</html>
16