How to reload page when back is pressed, after a pushState?
Since you are pushing the state from your ajax success method, you can detect the back button using the window.onpopstate
method.
Note that just calling history.pushState() or history.replaceState() won't trigger a popstate event. The popstate event is only triggered by doing a browser action such as a click on the back button (or calling history.back() in JavaScript).
var stateObj = { foo: "bar" };history.pushState(stateObj, "page 2", "bar.html");window.onpopstate = function(event) { if(event && event.state) { // event.state.foo }}