请教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