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

194
Vistas
How to open another html file from a page with Query params

I have two html files

  1. index.html
  2. search.html

on button click I want to open search.html and pass in some query params in URL.

I did this

 const params = new URLSearchParams({
        sol: something,
        art: art,
        querytext: getStartedText
    }).toString();
    window.location.href = "search.html/query?" + params

Which open this in new tab

file:///Users/someone/Desktop/someProject/search.html/query?sol=Select+SME+Area&art=Select+Artifact+Types&querytext=

but with 404 error saying that your file couldn't be found.

If I do just this

    window.location.href = "search.html"

It opens search.html page. Any idea on how I can fix it?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

This slash at the end makes the file system think that it's a folder

window.location.href = "search.html/query?" + params

It should rather look like this:

window.location.href = "search.html?" + params

P.S. You should consider using a local web server as working with file protocol isn't the best practice and can lead to unexpected behaviors when the website will be deployed.

about 4 years ago · Santiago Trujillo Denunciar
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