火狐浏览器beforeunload问题

3
$(window).bind("beforeunload",function(){
    return "cant be seen in ff";
});

问题是我无法在我的FireFox浏览器中看到确认框中的“在FF中看不到”,但其他浏览器(IE Chrome)都可以正常工作。
有什么解决方法吗?
3个回答

2

1
confirmOnPageExit : function( display ) {
      if ( true == display ) {
        var message;
        /* if unsaved changes exist, display a warning */
        if (false !== form_structure.unsaved_changes) {
            message = 'Warning!  Changes to the form builder have not been saved.';
                     return message;
        }
      }
},

window.onbeforeunload = confirmOnPageExit( false );

0

做这个

<script>
    window.onbeforeunload = function(){
         return "cant be seen in ff";
    }
</script>

这对我有效 - 我刚在FF 5中尝试过。无法测试您的jquery版本,没有jquery可用,例如作为书签(非常喜欢YUI3)。 - Mörre
这没有任何区别。 - naugtur

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接