我遇到错误,无法加载我的页面。
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/