Different ajax-contents have different dialog windows. First i load content and .js file in every page with:
- $( "#dialog-confirm-fin" ).dialog({...});
When i want to see another page, i'm destroying this content, but dialog window still there
- <div style="display: none; z-index: 1000; outline-width: 0px; outline-style: initial; outline-color: initial; " class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-dialog-confirm-fin">...</div>
And in DOM-tree i have many dialogs. What i need to do to delete them in every ajax-load??
I thought, that this code will help, but its not:
- $( "#dialog:ui-dialog" ).dialog( "destroy" );