I’m experiencing an error which wont let my page load.
Uncaught TypeError: Cannot read property ‘msie’ of undefined
The error in the console refer to this code:
if (jQuery.browser.msie)
extra_px += 3;
// Fix Link Clicking on IE 7 and below versions
if (jQuery.browser.msie && Number($.browser.version) < 8) {
span_text.css('cursor', 'pointer');
span_text.click(function() {
window.location = menu_item.parent().attr("href");
});
}
The weird thing is that it suddenly happened, I didn’t change a thing. For reference, I’m using WordPress.
source
As you can see in current version of jQuery, there is no
$.browser
property anymore.Most probably it was moved to plugin as was stated in docs.
So if you use the very last version of jQuery, the
undefined
error is understandable.Yes, jQuery.browser was deprecated in older version and removed in 1.9.So Now In old version if code written like this
will be replaced it by
Cheers!!!
As VisioN‘s answer mentions, this was removed in jQuery 1.9 and isn’t coming back anytime soon, it seems.
If you would like working Plugin to reAdd
$.browser
to your jQuery library, simply copy & paste the code below to a file and link the script in anywhere after jQuery:jsFiddle
Use traditionally like:
if ($.browser.msie) { doWork }
You can use the jQuery.Migrate library for deprecated function support like $.browser.
See https://github.com/jquery/jquery-migrate/#readme