- <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>
复制代码 看了你就明白,在body中的~ |
|