On my main page, I have a kind of sidebar that you can open and close. The sidebar is loaded via the jQuery download function in the div on the main page.
Some of the content loaded into this sidebar is a div (myDialog)
When a button is pressed on this sidebar, I call:
$("#myDialog").dialog({
title : "Permission",
width : 300,
height : 200,
modal : true
});
Now, if I close the sidebar and clear its contents using the jQuery empty function. Then I select all and the 'view source' html, which is added by jQuery at the bottom of the body. This causes problems when I open the sidebar again and try to open the same dialog, because there are two of this div (with duplicate identifiers).
I tried to add this, but it does not work:
close : function(){
$("#myDialog").dialog("destroy");
}
html, jQuery ? , ?