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);
一般返回的都是字符串,需要对其对象化
var json = eval(str);
console.log(json.data[0].uid);
一般返回的都是字符串,需要对其对象化
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |