我用JSON.stringify()方式把数据转换成json字符串,请问大神怎么把desc的值取出来
var obj={"desc":"my_test.department","child":[{"desc":"name2(string)","child":[]},{"desc":"count2(int)","child":[]}]};
解析json字符串 取出value值
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
4条回答 默认 最新
Leon-D 2016-09-12 03:06关注JS:
父对象的desc获取 : var fatherDesc = obj.desc;
对象的desc获取: var childs=obj.child;
childs.forEach(function(e){
alert(e.desc);
})本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报