我在 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
.
提前致谢。