javascript - jQuery.浏览器 : Javascript Uncaught TypeError

标签 javascript jquery wordpress typeerror

我遇到错误,无法加载我的页面。

Uncaught TypeError: Cannot read property 'msie' of undefined

控制台报错引用这段代码:

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。

最佳答案

jQuery.browser was deprecated in version 1.3, and finally removed in 1.9.

<子> source

正如您在 current version of jQuery 中看到的那样, 不再有 $.browser 属性。

很可能它已移至插件,如 docs 中所述.

因此,如果您使用最新版本的 jQuery,undefined 错误是可以理解的。

关于javascript - jQuery.浏览器 : Javascript Uncaught TypeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14337859/

相关文章:

javascript - 如何使用 JavaScript 将图像缩放到全屏?

javascript - 获取 parent.location.url - iframe - 从 child 到 parent

javascript - 在子菜单下方添加一行

javascript - 如何在 jwt-simple 中使 token 过期?

javascript - Jquery Flot 条形图不适合板子

javascript - 重新加载 Ajax 选项卡的内容

php - fatal error : Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes)

javascript - Wordpress 网站上的不安全 <form> 调用

javascript - InvalidPipeArgument : '[object Object], [对象对象]、[对象对象]、[对象对象]、[对象对象]、[对象对象]、

javascript - 单击表格行时如何从单元格中获取值