In JS, a handler is written for the button *удалить сообщение* (minimized). After updating messages (together with buttons) via ajax, the handler stops working.
How to solve a problem?
In JS, a handler is written for the button *удалить сообщение* (minimized). After updating messages (together with buttons) via ajax, the handler stops working.
How to solve a problem?
It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
Do delegated event handling:
$(document).on('click', '.delete-msg-btn', function(e){ /* code*/ }) I offer two options
onClick no longer quoted? We make the function and insert it into onClick and it will work under any conditions.
Source: https://ru.stackoverflow.com/questions/292818/
All Articles