【发布时间】:2011-05-25 04:56:23
【问题描述】:
我在 beforeload 事件上有一个确认框 - 代码如下:
window.onbeforeunload = function(){
//alert('leaving ... ' + is_edited );
if (is_edited == true) {
return confirm('Are you sure you want to navigate away from this page? \n\n Press OK to continue, or Cancel to stay on the current page.');
}
};
问题在于 - 确认警报显示两次。我已经在 stackoverflow 上进行了搜索,并收到了很多关于这个问题的问题。但我的有点不同。显示两次的确认警报不同。对于 FF,消息是相同的,但对于第二个确认框中的 Crome,消息是 false。
提前致谢。
【问题讨论】:
标签: jquery onbeforeunload confirm