I\'m having a problem with a \'popstate\' event handler, this is my code:
window.addEventListener(\"popstate\", function (event){
if (event.state) {
pushState do not trigger the popstate event, only clicking back / forward button (or use backspace) or invoking history.back() / history.go(n) would trigger this event.
Also, in webkit browsers, a popstate event would be triggered after page's onload event, but Firefox and IE do not have this behavior.