P
P
pillson2020-08-12 11:10:18
JavaScript
pillson, 2020-08-12 11:10:18

After refresh ajax doesn't see jquery events?

Good afternoon. Tell me what to do if after loading ajax where the content changes, it no longer sees events, I think because they are not visible in the dom tree, but what if the same handler contains many events? not to breed them. before, I just shoved the ajax handler to the very bottom, but I want to be more civilized

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
v3shin, 2020-08-12
@v3shin

More civil - hang events on document.

$(document).on('click', '.element', function(){...});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question