HTML 捕获window.close() 并做窗口关闭前的处理工作
时间:2014-05-15 18:08:09
收藏:0
阅读:474
转自:http://www.xinotes.net/notes/note/261/
1 <html> 2 <head> 3 <script language="JavaScript"> 4 function beforeunload(ev) { 5 var event = ev || window.event; 6 event.returnValue = "Are you sure you want to close this window? " 7 + "All of your work will be lost if you close"; 8 } 9 </script> 10 </head> 11 <body onbeforeunload="beforeunload(event);"> 12 Try close this window. 13 </body></html>
学习一下~!~
评论(0)