Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

300
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda