标题:请教foxjson如何用
取消只看楼主
laibinhua
Rank: 2
等 级:论坛游民
威 望:1
帖 子:205
专家分:31
注 册:2010-12-23
结帖率:56.36%
已结贴  问题点数:20 回复次数:0 
请教foxjson如何用
foxjson如何用,比如下面这段JSON
{"clientId":"1","code":"0","data":"[{\"costPrice\":1.0000,\"eName\":\"\",\"id\":\"703\",\"itemType\":\"13\",\"manufacturer\":\"\",\"name\":\"物质自我吱吱吱吱\",\"pingyin\":\"wzzwzzzz\",\"retailPrice\":1.0000,\"spec\":\"\",\"status\":\"1\",\"unit\":\"袋\"},{\"costPrice\":51.0000,\"id\":\"28\",\"itemType\":\"13\",\"manufacturer\":\"\",\"name\":\"迁移1\",\"pingyin\":\"\",\"retailPrice\":100.0000,\"spec\":\"\",\"status\":\"1\",\"unit\":\"mg\"}]","key":"926346261545844424498","msg":"成功","timer":1545844424498,"type":"110","versionType":"1"}
为什么我用 oJson.item("data").item(1).item("name").value 报错呢?取不到值 而且 oJson.item("data").count 也报错取不到值

原示例是这样,可以取到数据的:

oJson.Parse('{"name":"lee","age":32, "childs":[{"name":"xiao ming","age":2},{"name":"baobao","age":5}]}')
?oJson.item("name").value
?oJson.item("age").value
?oJson.item("childs").count
?oJson.item("childs").item(1).item("name").value
?oJson.item("childs").item(1).item("age").value
?oJson.item("childs").item(2).item("name").value
?oJson.item("childs").item(2).item("age").value
搜索更多相关主题的帖子: data name item value age 
2018-12-26 17:32



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-492305-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.205838 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved