js怎么获取json中的多个对象?
1个回答
展开全部
var str = {"code":0,"data":[{"uid":"689791","username":"vaghyuzhihao","orgid":"627","status":"1","subname":"yuzhihao","roleids":"1","orgcode":"600251","name":"yuzhihao","mapid":"0","passwd":"","siteid":"0","createorgcode":"600251","alarmview":"0"}]};
var json = eval(str);
console.log(json.data[0].uid);
一般返回的都是字符串,需要对其对象化。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询