美文网首页
遍历二维数组获取值

遍历二维数组获取值

作者: Medicine_8d60 | 来源:发表于2019-04-28 10:39 被阅读0次

    var ret =[{"result":1,"msg":"请求成功 ","list":[{"goodname":"属鼠-千手观音","user_id":2,"orderid":"1542643216144","trackingnumber":"","goodstate":0,"id":1,"goodid":"","detail":"{"username":"何少圳","goodname":"属鼠-千手观音","phonenum":"18202023544","address":"广东省北京市和平区","remark":"weixin"}"}]}];

    var dataJSON = ret.list;
    list_length = dataJSON.length;
    for(var i=0; i<list_length; i++) {
    var state = (dataJSON[i].goodstate) ? "已发货" : "备货中";
    var detail = dataJSON[i].detail;
    var detailObj = JSON.parse(detail);
    var detailUsername = detailObj.username; //获取username

    }

    相关文章

      网友评论

          本文标题:遍历二维数组获取值

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