I have this:
history.pushState({id:1}, 'new title', new_url);
Now, when someone uses the browser's back button, how do I retrieve the id (1)?
$(window).bind('popstate', function(event) {
event.state.id # gives an error
});
I tried the above (as suggested in an answer) and the error I get is "Cannot read property 'id' of undefined".