标签:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script> var thisPage=false; window.onbeforeunload=function checkLeave(e){ var evt = e ? e : (window.event ? window.event : null); //此方法为了在firefox中的兼容 if(!thisPage)evt.returnValue=‘离开会使编写的内容丢失。‘; } </script> </head> <body> </body> </html> </html>
JS浏览器关闭事件监听(http://pengjianbo1.iteye.com/blog/507569,http://bbs.csdn.net/topics/360152711)
标签:
原文地址:http://www.cnblogs.com/langdangyunliu/p/4274315.html