确定要离开当前页面吗

 1 <html xmlns="[url]http://www.w3.org/1999/xhtml[/url]">
 2    <head>
 3    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
 4    <title>onbeforeunload测试</title>
 5    <script>
 6    function checkLeave(){
 7          event.returnValue="";
 8    }
 9    </script>
10    </head>
11    <body onbeforeunload="checkLeave()">
12    </body>
13    </html>

 

posted @ 2012-07-08 22:33  Lyghost  阅读(283)  评论(0编辑  收藏  举报