【问题标题】:jQuery Uncaught TypeError: Cannot read property 'msie' of undefined in drupaljQuery Uncaught TypeError:无法读取drupal中未定义的属性'msie'
【发布时间】:2015-05-07 21:53:24
【问题描述】:

我的 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

【问题讨论】:

标签: jquery drupal


【解决方案1】:

您的 Drupal 网站中可能安装了 jQuery update 模块。

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

【讨论】:

    【解决方案2】:

    出现此问题是因为在 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>
    

    【讨论】:

      【解决方案3】:
      猜你喜欢
      • 1970-01-01
      • 2018-01-19
      • 1970-01-01
      • 2019-09-07
      • 2021-04-28
      • 2017-07-20
      • 1970-01-01
      • 2020-03-28
      • 2023-04-11
      相关资源
      最近更新 更多