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

297
Views
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
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!