【读书笔记】 网页关闭确认框
生活随笔
收集整理的這篇文章主要介紹了
【读书笔记】 网页关闭确认框
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
關鍵部分用粗黑體。
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;
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;
轉載于:https://www.cnblogs.com/dhuhank/p/4689902.html
總結
以上是生活随笔為你收集整理的【读书笔记】 网页关闭确认框的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 笔记本怎么创建摄像头快捷方式 创建笔记本
- 下一篇: 非root用户 gcc安装