I have a page that loads different lists dynamically, but also made seo friendly static pages for the lists. The buttons have 'a href' links that do a pushstate after which does replacestate. I want the history to remember only the last page clicked and go back to that static page, then when the visitor presses back once more to go to the first page (this.php).
My problem is that the first time I press back, it goes to the correct static page, but the second time i press back, it only changes the url, but doesn't change the actual page, the onpopstate doesn't trigger eighter. The curious part is that the forward button works fine through these pages, the issue only appears with the history back button.