cowboy/jquery-hashchange

IE8 does not add manual hash changes to history

justinjstark opened this issue · 1 comments

This is something that could be added to make things more consistent across browsers.

While I do not expect the hashtag to be changed manually, it can happen. When it does, no history item is stored in IE 8. In firefox, the history item is stored and the back button works.

(1) Load a page in IE8.
(2) Manually change the hashtag (or append one).
(3) No item is added to the browser history.

I used the following code for testing.

$(window).hashchange(function(){
    alert(location.hash);
});
$(window).hashchange();

An easy fix is to always include the hidden iframe in internet explorer. The following change fixes this issue.

supports_onhashchange = 'on' + str_hashchange in window && (!$.browser.msie);