slandau
slandau

Reputation: 24072

JQuery dialog freezing on close

$("#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");
                }
            }
        });

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

Do I define the close function correctly?

Upvotes: 2

Views: 2029

Answers (2)

Duane Gran
Duane Gran

Reputation: 490

To add to Vivek's answer (which resolved an issue I was having) I noticed that this only happens when the FireBug console is active. I hope that helps someone else who comes upon this problem. Prior versions of Firefox didn't seem to crash with this code.

Upvotes: 0

Vivek Goel
Vivek Goel

Reputation: 24160

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

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

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

You should have only this

 close: function(event, ui) { 

            },

Upvotes: 3

Related Questions