callbackname({ "response": 0, "message": "", "data": { "data": [{ "id": "39132", "uid": "39132", "first_date": "2016-03-01", "dateline": "2016-12-30", "no": 1 }, { "id": "28451", "uid": "28451", "first_date": "2016-03-01", "dateline": "2016-12-30", "no": 2 }], "field": { "credit": "\u4e2d\u6587\u4e00", "equity": "\u4e2d\u6587\u4e8c", "hx_yield": "\u4e2d\u6587\u4e09" } }});我想获取json中 dateline 的值,该怎么写
1 回答
GCT1015
TA贡献1827条经验 获得超4个赞
function callbackname(obj) {
var data = obj.data.data;
var arr = [];
for (var i = 0; i < data.length; i++) {
if (data[i].dateline !== undefined) {
arr.push(data[i].dateline)
}
}
return arr
}
添加回答
举报
0/150
提交
取消