Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$.browser is undefined #42

Open
thany opened this issue Mar 18, 2014 · 10 comments
Open

$.browser is undefined #42

thany opened this issue Mar 18, 2014 · 10 comments

Comments

@thany
Copy link

thany commented Mar 18, 2014

I'm getting this error:

TypeError: $.browser is undefined
Line 300

Hashchange 1.3
jQuery 2.1.0
Firefox 27 (this won't matter, but just for completeness)

I think the error speaks for itself.

@MxrBlind
Copy link

I got that issue too, and followed this fix:
For quick fix use this code:
change line 223:

  • if ($.browser.msie && parseInt(jQuery.browser.version) == 6) {
  • if (navigator.userAgent.match(/msie [6]/i)) {

I found it here: https://drupal.org/node/1961178

@msmuenchen
Copy link

This is likely due to $.browser being removed in jquery 1.9. http://api.jquery.com/jquery.browser/

@thany
Copy link
Author

thany commented Apr 18, 2014

@msmuenchen It's not likely, it's definately ;)

@thany
Copy link
Author

thany commented Apr 18, 2014

@MxrBlind I'm not sure checking for IE6 specifically is enough. The fallback is needed for IE7 and IE8 as well, iirc.

Otoh, jQuery is about to drop IE6&7 support fairly soon, a so check for IE8 only might prove sufficient in the near future.

@alexandrehebert
Copy link

Short term solution like "if ($.browser && ..." ?
Long term ? I dont know if we need to be backward compatible.

@thany
Copy link
Author

thany commented Jun 24, 2014

Yeah, if you leave issues be for long enough, they will disspear by themselves. In this case, the whole hashchange plugin has become obsolete now they many folks are supporting IE 9 and up.

Here's an idea: check jQuery version. Folks using jQuery 2.x will not be supporting IE8 and lower, so when jQuery 2.x is loaded, skip everything. When 1.x is loaded, do whatever Modernizr does.

Krinkle added a commit to Krinkle/jquery-hashchange that referenced this issue Jul 20, 2014
Fixes cowboy#42

Ideally we'd improve the feature test to not need this but looks
like we still need it for IE6/7 which pass the feature test but
do need this override in order to work properly.
@ghost
Copy link

ghost commented Nov 11, 2016

so what we can do?? Don't always use jquery version low 1.9 or use jquery migrate plugs ?? I think bast way is change origin code

@thany
Copy link
Author

thany commented Nov 12, 2016

Just don't use this plugin and use the native hashchange event. With many of our projects supporting no MSIE at all, the need for IE-specific code has gone down the toilet. Microsoft has deemed MSIE deprecated as well, in favour of Edge. And so should you.

@vinh28193
Copy link

@keithws
Copy link

keithws commented Mar 22, 2018

Just don't use this plugin and use the native hashchange event.

This should be the first line of the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants