本文介绍了如何自定义信息“您所做的更改可能无法保存。”为window.onbeforeunload?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<$>我做了一些搜索,发现有人在用:
window.onbeforeunload = function(){
if(hook){
return你保存了你的东西吗?
}
}
但是当我使用它时,您所做的更改可能无法保存。信息。
解决方案
您无法在Chrome 51中移除这项功能。它被广泛认为是一个安全问题,并且大多数供应商已经取消了支持。
I am testing in Google Chrome.
I did some search and found that someone is using:
window.onbeforeunload = function() {
if (hook) {
return "Did you save your stuff?"
}
}
But when I use it, I still got the "Changes you made may not be saved." message. How can I change it to something I want?
解决方案
You can't, the ability to do this was removed in Chrome 51. It is widely considered a security issue, and most vendors have removed support.
这篇关于如何自定义信息“您所做的更改可能无法保存。”为window.onbeforeunload?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!