Cancel jquery ui dialog completely

Im using

$('#test').dialog('destroy'); 

but it seems that automatically created elements are created on the page, I need to remove all possible elements that the dialogue hangs around in dom, is this possible?

+4
source share
1 answer

I had a similar problem, when recreating the dialogs, the elements in the old dialogue did not seem to be destroyed.

the solution is to erase the contents of the dialog when closing:

 $("<div>someelements</div>").dialog({ title:"sometitle", close: function() {$(this).html("");} }) 
+5
source

Source: https://habr.com/ru/post/1338825/


All Articles