如何在 chrome 中使用 onbeforeunload 修改消息
how to modify the message using onbeforeunload in chrome
我想在关闭browser.But时使用我的留言像"Are you sure?",下面的代码不要means.Chrome仍然给出默认提示。
window.onbeforeunload = function(){
console.log("test");
return 'the message I want to use';
}
chrome:51的版本.0.2704.106 m。求解答,谢谢。
从Chrome51开始,取消了onbeforeunload对话框中的自定义消息,取而代之的是显示不受网页控制的通用字符串。
阅读以下内容link了解更多详情:
我想在关闭browser.But时使用我的留言像"Are you sure?",下面的代码不要means.Chrome仍然给出默认提示。
window.onbeforeunload = function(){
console.log("test");
return 'the message I want to use';
}
chrome:51的版本.0.2704.106 m。求解答,谢谢。
从Chrome51开始,取消了onbeforeunload对话框中的自定义消息,取而代之的是显示不受网页控制的通用字符串。
阅读以下内容link了解更多详情: