I was wondering what could cause window.addEventListner('popstate', foo, false) window.attachEvent('onpopstate', foo)
and window.onpopstate=foo
to not trigger the function foo. We have code similar to this and in production it does not fire but in development it does. Is it possible to disable the popstate event via JS or cause some sort of collision or race condition for this to occur?
EDIT (Gustin): + Sample Code
PopStateEvent.js (complete listing, using jQuery 1.9.1):
$(window).bind('popstate', function () { alert("Pop state event received!"); });
If I'm testing this very simple example with IE 10 (10.0.9200.16484), I never receive a pop state event (i.e. the alert box never appears). Not even if I navigate away and come back via the back button of IE. I.e. this Q/A doesn't solve my case.
With Chrome 24, everything works fine.