zoukankan      html  css  js  c++  java
  • Uncaught TypeError: Cannot read property 'msie' of undefined

    1、错误描述

    Uncaught TypeError: Cannot read property 'msie' of undefined
        at Object._show (http://localhost:8080/cmp/js/jquery.hiAlerts-min.js:41:72)
        at Object.alert (http://localhost:8080/cmp/js/jquery.hiAlerts-min.js:2:317)
        at hiAlert (http://localhost:8080/cmp/js/jquery.hiAlerts-min.js:84:34)
        at HTMLButtonElement.<anonymous> (http://localhost:8080/cmp/js/page/index.js:62:4)
        at HTMLButtonElement.dispatch (http://localhost:8080/cmp/js/jquery-1.11.0.min.js:3:8066)
        at HTMLButtonElement.r.handle (http://localhost:8080/cmp/js/jquery-1.11.0.min.js:3:4767)

    2、错误原因

          由于jquery 1.9以及以上版本不支持$.browser.msie和$.browser.version这两个方法,而页面引入的是jquery-1.11.0.min.js,版本比1.9更高,不支持上述两个方法,导致出现这个错误


    3、解决办法

         将if条件判断

    if ( a.browser.msie && parseInt(a.browser.version) <= 6)) {
          c = c + a(window).scrollTop()
    }
    if (a.browser.msie && parseInt(a.browser.version) <= 6)) {
          b = b - 175
    }
         修改为

    if ( 'undefined' == typeof(document.body.style.maxHeight)) {
          c = c + a(window).scrollTop()
    }
    if ('undefined' == typeof(document.body.style.maxHeight)) {
          b = b - 175
    }


  • 相关阅读:
    flex 布局 shrink 属性
    flex 布局 flex-grow 属性
    flex 布局 flex-basis 属性
    flex 布局 justify-content 对齐的图解
    CSS定位要点笔记
    CSS浮动要点笔记
    CSS选择器要点笔记
    eslint no-unused-vars 解决办法
    NodeJs使用Promise解决多层异步调用的简单学习
    windows10 搭建 NTP 时间服务器
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313961.html
Copyright © 2011-2022 走看看