jQuery.browser: Javascript Uncaught TypeError [英] jQuery.browser: Javascript Uncaught TypeError
问题描述
我遇到了无法加载页面的错误.
I'm experiencing an error which wont let my page load.
未捕获的类型错误:无法读取未定义的属性 'msie'
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");
});
}
奇怪的是它突然发生了,我没有改变任何事情.作为参考,我使用的是 Wordpress.
The weird thing is that it suddenly happened, I didn't change a thing. For reference, I'm using Wordpress.
推荐答案
jQuery.browser 在 1.3 版中被弃用,最后移除1.9.
jQuery.browser was deprecated in version 1.3, and finally removed in 1.9.
正如您在 当前版本的 jQuery 中所见,没有 $.browser
财产了.
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.
因此,如果您使用最新版本的 jQuery,undefined
错误是可以理解的.
So if you use the very last version of jQuery, the undefined
error is understandable.
这篇关于jQuery.browser: Javascript Uncaught TypeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!