beforeunload事件在IE中触发两次

时间:2012-06-12 08:32:59

标签: jquery javascript-events

  

可能重复:
  onbeforeunload Message Appears Twice (Internet Explorer)

我面临在IE上两次触发beforeunload事件的问题。以下代码适用于其他浏览器。

    window.onbeforeunload = function (evt) {
        evt.preventDefault();
        evt.stopImmediatePropagation();
        evt.stopPropagation();

        if (isDirty) {
            isDirty = false;
            return dirtyMsg;
        }
    };

我看过很多其他帖子,但没有解决。

由于

0 个答案:

没有答案
相关问题