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

122
Views
Dynamically remove and add injected script in html page

I have project where there are two different js bundles served to the user. If the user is logged in bundle B is served and if the user is not logged in, user is served bundle A. I also have an index.html page where the bundle A is injected like below.

 <script
      type="text/javascript"
      src="dist/A.js"
 ></script>

Bundle A has code that is capable of making api calls to log the user in. Now, when the user logs in and gets response from the server, I want to serve bundle B to the user using the same index.html file. How can this be achieved?

My questions

  • Can this be achieved? How?
  • Even if this can be achieved, will bundle A still have effects after B is applied?
about 4 years ago · Juan Pablo Isaza
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!