How to make the back button work after pushState in Chrome / Safari -


i have error handler in single page app reloads page if ajax request fails reason, displaying error response user. chrome , safari, subsequent click of button leave user on error page (though url updated original page.)

minimal code reproduce:

var missing_url = window.location.pathname + '/missing' window.history.pushstate({test:'test'}, 'new page', missing_url); // reloading return 404 window.location.reload(); 

demo: http://bl.ocks.org/lrowe/raw/5551102/

source: https://gist.github.com/lrowe/5551102

as far can tell nothing caching, when clicking nothing shows in network panel , see same behave when browser cache disabled.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -