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

    1、错误描述

    jquery-1.9.1.min.js:69 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
    send @ jquery-1.9.1.min.js:69
    public.js:430 
    Uncaught TypeError: Cannot read property 'hasOwnProperty' of null
        
    at Object.<anonymous>  
    at Function.each (jquery-1.9.1.min.js:35)
          
    at HTMLTableElement.loadComplete    
    at Object.success (jquery.jqGrid.src.js:2012)
        
    at c (jquery-1.9.1.min.js:35)
        
    at Object.fireWith [as resolveWith] (jquery-1.9.1.min.js:35)
        
    at k (jquery-1.9.1.min.js:69)
        
    at XMLHttpRequest.r (jquery-1.9.1.min.js:69)
    porder.js:769 payType:1
    
    Uncaught TypeError: Cannot read property 'hasOwnProperty' of null
        
    at Object.<anonymous>  
    at Function.each (jquery-1.9.1.min.js:35)
          
    at HTMLTableElement.loadComplete    
    at Object.success (jquery.jqGrid.src.js:2012)
        
    at c (jquery-1.9.1.min.js:35)
        
    at Object.fireWith [as resolveWith] (jquery-1.9.1.min.js:35)
        
    at k (jquery-1.9.1.min.js:69)
        
    at XMLHttpRequest.r (jquery-1.9.1.min.js:69)

    2、错误原因

          hasOwnProperty()函数用于指示一个对象自身(不包括原型链)是否具有指定名称的属性,一般语法是:

         对象.hasOwnProperty(属性值),如果对象为null,就会报错;在判断之前先判断对象是否为空


    3、解决办法

    if(对象 != null)

    {

    对象.hasOwnProperty(属性值)

    }

  • 相关阅读:
    [题解] LuoguP6185 [NOI Online 提高组]冒泡排序
    [题解] LuoguP5339 [TJOI2019]唱、跳、rap和篮球
    [题解] LuoguP4168 [Violet]蒲公英
    [题解] LuoguP4705玩游戏
    [题解 LuoguP4491 [HAOI2018]染色
    [题解] LuoguP3768 简单的数学题
    杜教筛
    莫比乌斯反演学习笔记
    [题解] LuoguP2257 YY的GCD
    [题解] LuoguP2764 最小路径覆盖问题
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313860.html
Copyright © 2011-2022 走看看