2
$("#termSheetPrinted").dialog({
autoOpen: false,
resizable: true,
height: $(window).height() - 50,
width: $(window).width() - 50,
position: 'center',
title: 'Term Sheet',
beforeClose: function(event, ui) { $("#termSheetPrinted").html(''); },
modal: true,
buttons: {
"Print": function() {
$("#termSheetPrinted").jqprint();
},
"Cancel": function() {
$("#termSheetPrinted").html('');
$(this).dialog("close");
}
}
});
所以,当我点击'取消'时,我可以再次生成对话框,一切都很正常。如果我点击右上角的'X'并再次生成它,它会翻倍,还没有从上次清除。JQuery对话框关闭事件
我试着添加beforeClose
事件清除HTML,但它似乎并没有工作。
如何从“取消”和“X”中正确清除并关闭?