这样的复杂Json数据怎么样解析呢,向大神求助要,最好能贴下代码,谢谢了!
{"floors":[{"fid":1,"fname":"主层","room":[{"dev":[{"did":1,"devid":1,"cmd":[{"cid":400...
{"floors":[{"fid":1,"fname":"主层","room":[{"dev":[{"did":1, "devid":1,"cmd":[{"cid":400,"cname":"电视"},{"cid":401,"cname":"电视"}],"dname":"电视","tid":3},{"did":2, "devid":2,"cmd":[{"cid":402,"cname":"冰箱"},{"cid":403,"cname":"冰箱"}],"dname":"冰箱","tid":3},{"did":3, "devid":3,"cmd":[{"cid":404,"cname":"电暖"},{"cid":405,"cname":"电暖"}],"dname":"电暖","tid":3},{"did":4, "devid":4,"cmd":[{"cid":406,"cname":"风扇"},{"cid":407,"cname":"风扇"}],"dname":"风扇","tid":3},{"did":5, "devid":5,"cmd":[{"cid":408,"cname":"音响"},{"cid":409,"cname":"音响"}],"dname":"音响","tid":3}],"rname":"玄关","rid":1},{"dev":[],"rname":"客厅","rid":2}]},{"fid":2,"fname":"复层","room":[{"dev":[],"rname":"客厅","rid":1},{"dev":[],"rname":"偏厅","rid":2},{"dev":[],"rname":"娱乐室","rid":3}]},{"fid":3,"fname":"厨卫","room":[{"dev":[],"rname":"客厅","rid":1},{"dev":[],"rname":"书房","rid":2},{"dev":[],"rname":"套房","rid":3},{"dev":[],"rname":"主卧","rid":4}]}]}
要求能拿到里面所有"cid"的值。 展开
要求能拿到里面所有"cid"的值。 展开
推荐于2016-04-04
展开全部
var DATA='[{"data":{"x":{"precision":2,"subtype":"","type":"array","unit":" ","value":[-23.93000030517578]},"y":{"precision":2,"subtype":"","type":"array","unit":" ","value":[-8.890000343322754]}},"devtype":"DAIS","msg":"multidata","netid":1128,"nodid":2501,"nvsid":2001181,"version":2}]';
eval(DATA);
eval(DATA);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询