Estoy ejecutando este código en algún punto de mi sitio:
function test(){ var script = document.createElement("script"); script.src = "https://my_script.js"; script.type="text/javascript"; script.charset="UTF-8"; document.getElementById("testing").appendChild(script); }Funciona bien la primera vez, pero luego me gustaría eliminar todo el código que inyectó .js y volver a ejecutar mi función, pero esta vez cambiando la fuente de URL, pero recibo la siguiente advertencia y no hace nada:
@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning.
Es solo una página web local con html y javascript normales.
¿Alguien puede decirme qué puedo hacer, o si lo que quiero hacer está bien o no debería hacerlo?
¡Gracias!