javascript - Structure for handling several script loaded from ajax -
As so many people, I have a problem handling scripts from external pages loaded with AJAX.
I'm trying to set up an "admin panel" page on it. I want to be able to navigate to many admin pages within the panel. Different admin pages include internal I did a small test on one of the admin pages: Here, whenever I come back to this page, it will bind another click so that I can get two alerts every time I click the div. I can easily solve it by running However for some admin pages there are plenty of .click / .change / .live and I do not even know what they are (i.e. external plugins From). So can I remove / remove / remove all the scripts loaded from each Ajax-loaded page without any interruption? I know that I can use the selectors with unbound, but it does not seem very effective for loop on each div / img / input etc and has not been banned, and I do not even know that it Will work. In this way I load the admin page: Any help is appreciated, Cheers! Structure of the page: If you show us the structure of elements, but by definition Jquery "Remove" should remove this element, its children, all incidents and any data related to it. Is div.panel__inner located inside your body tag? I think you are taking a conclusion on the div, but are preparing data for $ ('body'). Can you remove the body's content yourself? & lt; Script & gt; and external JS-files are included in the scripts as much as they want, but they are stacked or they are not managed in any good way.
$ ('.left-col'). Click (function () {alert ();});
$ ('left-col'). Unbind (); in my ajax.success
& Lt; html & gt; & lt; body & gt; & lt; div class = " Panel paper "& gt; & lt;! - Admin panel - & gt; & gt; & gt; / div & gt; & lt ;! - Rest site site - & gt; & lt; / body & gt; & lt; / html & Gt;
Comments
Post a Comment