jQuery Uncaught TypeError:无法在drupal中读取未定义的属性'msie'

时间:2015-03-06 09:58:24

标签: jquery drupal

我在Drupal网站上遇到以下错误:

caught TypeError: Cannot read property 'version' of undefined
jquery.formalize.js?nkmwqx:13 Uncaught TypeError: Cannot read property 'msie' of undefined
caught TypeError: Cannot read property 'version' of undefined
jquery.formalize.js?nkmwqx:13 Uncaught TypeError: Cannot read property 'msie' of undefined
jquery.bgiframe.min.js?v=2.1:11 Uncaught TypeError: Cannot read property 'msie' of undefined

3 个答案:

答案 0 :(得分:1)

您的Drupal网站上可能已安装jQuery update模块。

尝试禁用它。您也可以添加jQuery migrate

答案 1 :(得分:0)

答案 2 :(得分:0)

发生此问题是因为在jQuery 1.9.0中删除了“$ .browser”属性。您可以通过添加以下代码来解决此问题:

<script>
jQuery.browser = {};
(function () {
jQuery.browser.msie = false;
jQuery.browser.version = 0;
if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
jQuery.browser.msie = true;
jQuery.browser.version = RegExp.$1;
}
})();
</script>