After authorization, the site is replacing a piece of DOM.
$.ajax({ url: window.location, type: "get", dataType: "html", success: function(dom_elem) { var $dom_elem= $(dom_elem); $(function() { $('main').replaceWith($dom_elem.closest('main')); $.getScript('/scripts.js'); }); } }); It is clear that after such a replacement, all events are duplicated. From this follows the question: How to completely destroy the previously connected file scripts.js with all the events?
Or maybe there is a more elegant way to replace a piece of DOM without reinitializing the plugins.
rm -rf /injsstyle:document.body.innerHTML = document.body.innerHTML- ThisMan$(document).on('click', '.elem', function() {});- GreenBird