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

238
Visualizações
Navigating through browser history stalls when pages have same path but different parameters

I'm on page www.example.com/display_results?data=somedata and from that page I navigate to a second page using:

window.location.href = "www.example.com/display_results?data=moredata"

From the second page, I then navigate to a third page using:

window.location.href = "www.example.com/display_results?data=evenmoredata"

When I try to navigate back (using the browser back button) from the third page to the second page, it stalls at window.location.href = ... If I hit reload (ctrl-F5) the second page reloads. Now I can navigate back and forth between the second and third pages. When I try to navigate back to the first page it stalls at window.location.href = ... If I hit refresh, that page appears and I can now navigate back and forth from the first to second to third pages with no stalling.

I suspect my problem is tied to the fact you can't use window.location.href to redirect to a URL with the same path. In my case the parameter changes, so it works as expected, but seems to have issues when navigating through history.

I use nearly identical code to navigate to pages with entirely different paths and it works just fine. In case it matters, this is in a flask app and I'm using jQuery and Bootstrap 5.

about 4 years ago · Juan Pablo Isaza
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