Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
How to redirect to an html page with parameters?

I have two HTML pages running on a localhost server and would like for the first page to redirect to the other one but with parameters so that I can use queries on the second page. This is my code in javascript:

var number = 5;
window.location.href = "page2.html/?numberID=number";

So that the new page will have the URL: localhost/page2.html/?numerID=5, but code just gives me a 404 page not found error, how do I fix this?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You need to remove the slash between the page name and the question mark, otherwise the web server will think you are requesting a folder named /page2.html/, hence you are getting 404 - not found

localhost/page2.html?numberID=5
about 4 years ago · Juan Pablo Isaza Relatório

0

var number = 5;
window.location.href = "page2.html?number="+number;
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda