Can I unload JavaScript?

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();
};
+4
source share
1 answer

, js ( "unload js" ). ( per script), . . js, , - .

0

Source: https://habr.com/ru/post/1545839/


All Articles