$('.btn').click(function(event){
var paged = $(this).attr("id");
history.pushState(paged, "", event.target.href);
$.ajax({
do something
}
});
});
window.onpopstate = function(event) {alert(event.state); };
Use Chrome, Safari, Firefox to check it,
only Chrome and Safari can show the alert (message = paged) when the back button is clicked, but Firefox shows null value for the alert message,
and thus, I cannot use onpopstate to load a previous page content to Firefox when the back button is clicked. Then how to solve it or push the event.state correctly, but not a null value for firefox :)?