捕获关闭窗口的脚本

  <html>

  <body>

  <script>

  function LeaveWin(){

  event.returnValue="call,确定要关闭吗";

  }

  window.onbeforeunload=LeaveWin;

  </script>

  </body>

  </html>