Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript IE + popstate… hmmm Reply To: IE + popstate… hmmm

#164392
dyr
Participant

You could try the ‘hashchange’ event which is fired with the hash part of the URL changes, as opposed to ‘pop state’ which is fired when a new entry in the history is added (such as when clicking an anchor element.)

http://caniuse.com/#feat=hashchange

You could also rip the history API detection from Modernizr or roll your own to detect whether pop state is available.

if (window.history && window.history.pushState) {
   // bind pushstate stuff
} else {
  // bind hash change stuff
}

I’m not sure if this actually would solve your issue but it’s a starting point.

Cheers