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

305
Vistas
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
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