jQuery对话框在关闭时冻结 [英] JQuery dialog freezing on close

查看:57
本文介绍了jQuery对话框在关闭时冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$("#termSheetPrinted").dialog({
            autoOpen: false,
            resizable: true,
            height: 800,
            width: 950,
            position: 'center',
            title: 'Term Sheet',
            close: function(event, ui) { 
                $(this).dialog("close");
            },
            modal: true,
            buttons: {
                "Print": function () {
                    $("#termSheetPrinted").jqprint();
                },
                "Cancel": function () {
                    $("#termSheetPrinted").html('');
                    $(this).dialog("close");
                }
            }
        });

当我单击右上角的"x"时,Firefox死机,崩溃,什么也没发生.

When I click the 'x' in the upper right hand corner, firefox freezes, crashes, and nothing happens.

我是否正确定义关闭功能?

Do I define the close function correctly?

推荐答案

您在关闭时具有无限递归. 尝试此代码以查看它.

you have infinite recursion on close. try this code to see it.

 close: function(event, ui) { alert("close is called");

            $(this).dialog("close");
        },

您应该只有这个

 close: function(event, ui) { 

            },

这篇关于jQuery对话框在关闭时冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆