jQuery.browser:Javascript Uncaught TypeError [英] jQuery.browser: Javascript Uncaught TypeError

查看:117
本文介绍了jQuery.browser:Javascript Uncaught TypeError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个错误,它不会让我的页面加载。

I'm experiencing an error which wont let my page load.


未捕获的TypeError:无法读取属性'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.

很可能它被移动到插件中,如< a href =http://api.jquery.com/jQuery.browser/> docs 。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆