码迷,mamicode.com
首页 > Web开发 > 详细

【读书笔记】 网页关闭确认框

时间:2015-07-30 18:53:38      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:

关键部分用粗黑体。
function goodbye(e) { if(!e) e = window.event; //e.cancelBubble is supported by IE - this will kill the bubbling process. e.cancelBubble = true; e.returnValue = ‘You sure you want to leave?‘; //This is displayed on the dialog //e.stopPropagation works in Firefox. if (e.stopPropagation) { e.stopPropagation(); e.preventDefault(); } } window.onbeforeunload=goodbye;

【读书笔记】 网页关闭确认框

标签:

原文地址:http://www.cnblogs.com/dhuhank/p/4689902.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!