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

307
Views
why does index.html keep opening as https://www.google.com/index.html?

Im trying to check for a keyword in the url and launch an html file from javascript

here is my code:

window.setInterval(function doTheTing() {
        if (window.location.href.indexOf("keyword") > -1) {
            window.location.replace("index.html")
        }
    }, 1000)

what im trying to do is open the file when the keyword is in url, and it does work, but for some reason when i try to open index.html it opens https://www.google.com/index.html instead

*if the keyword is in the url of a youtube video than it opens as https://www.youtube.com/index.html (which isnt a real domain so it just shows an error page)

*if its from a tiktok than https://www.tiktok.com/index.html (which also returns an error page)

and so on...

how can i just open index.html?

thanks for the help

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!