您的位置:首页 > Web前端 > JavaScript

离开页面前调用Js方法

2012-02-27 12:41 267 查看
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
   <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
   <title>onbeforeunload测试</title>
   <script>
   function checkLeave(){
    event.returnValue="确定离开当前页面吗?";
   }
   </script>
   </head>
   <body onbeforeunload="checkLeave()">
   </body>
   </html>


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: