JQuery closing window and deleting div

Please, help! I designed a panel that uses gadgets. One of the gadgets creates a dialog, but each time the gadget is updated, it creates a different dialog with the same identifier. This dialog box contains a form, so there are problems with receiving and sending the value of my input, since my page has an identical identifier.

What is the best way to destroy newly created dialogs and then remove this div from the DOM without affecting my originally created dialog?

+3
source share
2 answers

add this to your dialog:

close: function (ev, ui) {
            $(this).dialog("destroy");
            $(this).remove();

        },

this will destroy the dialog and remove the div when it is closed.

+6
source

cookie, ", , ", , cookie ?

0

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


All Articles