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.
The $.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery. Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself.
Out of the six primitive types defined in JavaScript, namely boolean, string, symbol, number, Null, and undefined, no other type throws as many errors as Undefined. The error most often than not is faced when the scripts come across uninitialized variable or object. ‘Undefined’ is the property of the global object.
Note: This API has been removed in jQuery 1.9; please rely on feature detection instead. The $.browser property provides information about the web browser that is accessing the page, as reported by the browser itself.
Out of the six primitive types defined in JavaScript, namely boolean, string, symbol, number, Null, and undefined, no other type throws as many errors as Undefined. The error most often than not is faced when the scripts come across uninitialized variable or object.
jQuery.browser was deprecated in version 1.3, and finally removed in 1.9.
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
isIE6 = jQuery.browser.msie && jQuery.browser.version < 7 && !window.XMLHttpRequest,
will be replaced it by
isIE6 = navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest,
Cheers!!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With