2011-02-22 73 views
2
$("#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會凍結,崩潰並且什麼都不會發生。JQuery對話框凍結關閉

我是否正確定義關閉功能?

回答

3

您關閉時有無限遞歸。 試試看這個代碼。

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

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

您應該只有這

close: function(event, ui) { 

      }, 
0

爲了增加維韋克的答案(該解決的問題,我有)我注意到,當Firebug控制檯激活這只是發生。我希望能夠幫助解決這個問題的其他人。此舊版本的Firefox似乎沒有與此代碼崩潰。