Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!