I'm doing some AJAX page reloading and everything works great, expect that popState
only works backwards. I can go back in history, but I cannot go back forward. The question is, should popState
work in both directions and if not, what's the opposite method to watch for moving forward?
To be exact, I've got both on-click pushState
to work and popState
to return me back. What doesn't work is going forward after returning back.
Example: I click on my links 3 times and go through A-B-C
states. Now, I click back and end up at B
. Lastly, I want to click "forward" in the browser (and not on my app) and thus end up at C
. Well, the browser state changes, but I don't end up with C
. Does it mean that I have to write pushState
for browser-based behavior too? I was under impression that popState
should handle both back and forward behaviors?