cowboy / jquery-hashchange

This jQuery plugin enables very basic bookmarkable #hash history via a cross-browser HTML5 window.onhashchange event.
http://benalman.com/projects/jquery-hashchange-plugin/
GNU General Public License v2.0
1.21k stars 258 forks source link

$.browser was removed #28

Open matrym opened 11 years ago

matrym commented 11 years ago

http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed

hashchange depends on it.

niftylettuce commented 11 years ago

:+1:

BillyRayPreachersSon commented 11 years ago

One way around this, to detect IE only, is to use IE's conditional compiler comments. For more information, see http://msdn.microsoft.com/en-us/library/ie/121hztk3(v=vs.94).aspx

Instead of testing for this:

$.browser.msie && !supports_onhashchange ...

test for an msie variable (or whatever you want to call it), that is only set to true if running in IE:

var msie = false;
/*@cc_on
    msie = true;
@*/

msie && !supports_onhashchange ...
Neil-Partridge commented 11 years ago

This worked fine for me

navigator.userAgent.match(/msie/i) && !supports_onhashchange && (function(){

konsumer commented 11 years ago

I think #30 is a better solution.