I´m having troubles with
DOM anymore, and they appears as
My DOM structure is like this:
<body> <header></header> <main id="contentToBeReplaced"> <p>New content with its own js</p> <script> var script = "js/new.js"; $.getScript(script); </script> </main> <footer></footer> <script src="js/main.js"></script> </body>
So, whats the problem and how can I fix this? I need to prevent duplicated files and remove the js file when a new its loaded.