【发布时间】:2013-06-11 12:43:51
【问题描述】:
if(!$('fieldset.quote-step4').hasClass('show')) {
window.onbeforeunload = function() {
return "Are you sure you want to leave the quote request page? This will reset the form.";
}
} else {
window.onbeforeunload = undefined;
}
我在私有函数内部的脚本中有上述内容,导致 ie8 中出现“未实现”错误。
导致错误的具体行是:window.onbeforeunload = undefined;
根据我在其他问题中阅读的内容,window 应声明为局部变量以解决此问题——但我不确定如何。
谁能向我解释这个错误和可能的解决方案?
谢谢!
【问题讨论】:
-
嗯,不要那样做?你想做什么?
-
已编辑问题以显示更多细节
标签: javascript jquery internet-explorer internet-explorer-8 onbeforeload