in a single page web app, if I create jquery ui dialog on the fly like this:
$("<div>hello</div>").dialog({
buttons : {
"cancel" : function() {
$(this).dialog("close");
}
}
});
Do I need to do any special clean up after each closing? Do I need to call dialog’s “destroy”?
You should call
destroyif you plan to completely re-create the dialog each time it’s opened, as would happen it the code above is called more than once.If the dialog only gets opened once, it doesn’t matter.