首页 > Web开发 > 详细

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

时间:2015-07-30 18:51:02      阅读:135      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!