Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

167
Visualizações
How to remove and reload external script tag functionality javascript

I am running this code at some point of my site:

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);
}

It runs well the first time, but then I would like to remove all the code the .js injected and re-run again my function, but this time changing the url source, but I get the following warning and does nothing:

@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.

It's just a local webpage with normal html and javascript.

Can anyone tell me what can I do, or if what I want to do is ok or should I not be doing that.

Thanks!

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda