Is it possible to unload JavaScript with out a page reload?
It's easy to add a file dynamically by ajaxing a file in and appending it to the DOM.
But what about the opposite.
Is there a way to unload a file?
My understanding is that if I append a script element, the JS is loaded. However if I dynamically remove the script element, the JS remains loaded.
Is there a way to unload a JS file.
Here is an example of a dynamic load:
script_el.src = base + 'some_path' + '?_time=' + new Date().getTime();
document.head.appendChild(script_el);
script_el.onload = function () {
libHasLoaded();
};