0

I use $.getScript many times in my page for loading my controllers,

when user click on each link, a javascript file will load with getScript . the user maybe click on several links and many javascript files loading, so the browser get more resource.

How can I cleanup the javascript files from browser after it works done.

tshepang
  • 12,111
  • 21
  • 91
  • 136
MajAfy
  • 3,007
  • 10
  • 47
  • 83
  • Duplicate: http://stackoverflow.com/questions/591685/how-can-i-dynamically-unload-a-javascript-file – random_user_name Apr 30 '12 at 20:09
  • @cale_b thank you but that link show how we can remove just script tag from our page, I want to know how can I unload script from browser – MajAfy Apr 30 '12 at 20:13
  • Read the last post. Allegedly it may (or may not, I'm not clear) remove from browser/memory. – random_user_name Apr 30 '12 at 20:14
  • Removing the script will of course not undo what the script has already done(such as adding properties and methods to the global scope). There is no way to automatically remove these methods and properties other than doing it manually. Maybe it would be better to write your code in such a way that it only loads the file if it hasn't already been loaded. – Kevin B Apr 30 '12 at 20:46

0 Answers0