I am trying to implement this like this:
<a href="#"
onclick='pushstate(function1(),"title",function1) return false;'>
Function1
</a>
This link works so my AJAX comes onto the page. However when I call the onpopstate when the back button is pressed, the function doesn’t get recalled. When I alert my event.state I get undefined. How can I implement this, so that I can actually call back my function when the back button is pressed?
You have to capture the
popstateevent on the window, how are trying to intercept it at the moment?Here’s a full tutorial.