javascript - can window.onPopState() event handler know direction of navigation? (forward,backward) -
I use Ajax Navigation with the PuestState () method and an Oppstate () handler.
When going to the main page for the first time, I display a default content (without Ajax).
When a person goes away from the default page and then "goes back", then an empty position is given when they should return to the default page thus, Live on the page (though handler can easily use AJAX to get back the initial content).
The only way to decide what is the pushstate initial content, with my initial page load with information about this method, the "back" button works great!
But if someone was going to www.stackoverflow.com, the stackflow goes "back" and then goes "forward" to my site, shows initial content, but again again Loads from "Popped" state because the state is not empty.
So can I tell in the onPopState () handler, whether the user is going backward or forward?
Comments
Post a Comment