Can I unload JavaScript with page reloading?
It is easy to add a file dynamically by placing the file and adding it to the DOM.
But what about the opposite.
Is there a way to upload a file?
I understand that if I add a script element, JS will load. However, if I dynamically delete the script element, JS remains loaded.
Is there a way to upload 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();
};
user3293653
source
share