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

305
Visualizações
How to stop code from running in another file in html/javascript

I have a file called login.html. In this file I have this code:

        onAuthStateChanged(auth, (user) => {
        if (user) {
            console.log("there is a user now xD")
            window.location.href = "/HomePage/Home.html"
        } else {
            console.log("No user big boy")
        }
    })

Basically all that this code does is check if a user is logged into firebase and if they are logged in it takes them to a the home page.

I have another view called createAccount.html. When I finish creating an account it automatically logs in the user which makes the code above run in login.html because the onAuthStateChanged function has changed.

My question is why is the code from login.html running even though I am in createAccount.html? And how do I stop it from running?

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