美文网首页
JS——object类型取值

JS——object类型取值

作者: 兰觅 | 来源:发表于2020-07-14 15:46 被阅读0次

    输出 console.info(data);
    数据类型如下:

    {
    "total":2,
    "rows":[
            {"ss":5,"docRev":"A","inspectionType":"外观检验","docNo":"CQKA-0003","failName":"脏污","aQty":3,"inspectConditionStepMethod":"目视","aql":"0.65","ssName":"C=0","pn":"SSS25-01"},
            {"ss":5,"docRev":"A","inspectionType":"外观检验","docNo":"CQKA-0003","failName":"破洞","aQty":3,"inspectConditionStepMethod":"目视","aql":"0.65","ssName":"C=0","pn":"SSS25-01"}
            ]
    }
    

    取ss的值:

      for (var i in data.rows){
                    console.info(i);  //输出0,索引
                    console.info(data.rows[i].ss+"---ss:");  //输出5
    }
    

    相关文章

      网友评论

          本文标题:JS——object类型取值

          本文链接:https://www.haomeiwen.com/subject/ishfhktx.html