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.