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

123
Visualizações
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
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