0

this question seems to be more difficult than I thought. I am creating an app, which needs to load different frameworks for different pages. Loading all at once would be an overkill and too expensive in regards of resources. So I basically thought about "unloading" a script / framework. I learned that this is not working as easy as just removing the script tag from the browser, apparently there are some events bound and functions are still available, etc. which are lasting after the script removal. My question is what "features" more than events and functions actually can be loaded with the script and is there an already existing solution to clean them all up somehow?

I am very excited for an answer.

Kind regards, Marius

marius
  • 1,118
  • 1
  • 18
  • 38

2 Answers2

-1

Marius when you say load different frameworks are you talking about loading different javascript libraries? If thats the case, then none of the variables or events in the library stay persistent when a new web page is loaded into the browser that doesnt use that library. Cookies and cached data can stay persistent, but that's usually not managed by a library.

natesrc
  • 61
  • 1
  • 3
  • 1
    He's not opening a new web page. He's modifying the DOM of the current page by removing the ` – Barmar Apr 05 '17 at 23:01
-2

You can try jQuery.getScript if you want to load a JS script ad-hoc.

Rogidi
  • 1
  • 1