Greetings to all!

The problem looks like this: you need to track the appearance of new elements ( <div> block) and apply a plug-in to them after the appearance. The blocks are the same, appear on the "Add" button.
Maybe with the help of delegation it is possible, or to track the appearance of an element on the page, or the arrival of a post-response, or something else?

    1 answer 1

    jQuery API .on ()

     $(".parent").on("click", "div", function() { $(this).activateYourPlugin(); }); 

    Where .parent is the parent block (unchangeable by AJAX) containing your divs.

    • Thanks for the answer. I was thinking about a similar decision, but I was confused by the click event. Will it be queued and guaranteed to hang the plugin, because click on the "Add" button occurs a little earlier than the Ajax answer comes? And another question, I correctly understand, in the proposed example, the event of clicking on any <div> in the partent () container is handled? - RocketBoom
    • Yes, I tried it - it does not have time, it works before the update. - RocketBoom
    • api.jquery.com/jquery.when this is usually used like. - iksuy
    • Thanks, looked - looks like what you need. But does not work. ) In the browser, you can see the POST request and response to it, but for some reason it does not work out to catch it by the URL. It works only when the page loads. - RocketBoom