一般解析 {
"code": 0,
"whwswswws": "ej7ltErOLmBq00vH-Cg2EFw",
"openall": 1,
"openalltouch": 1,
"processtype": 1,
"appidStatuscode": 0
} JSON. 解析 ( #INFO, , )调试输出 (JSON. 取属性对象 (“code”)) 调试输出 (JSON. 取属性对象 (“whwswswws”)) 调试输出 (JSON. 取属性对象 (“openall”)) 调试输出 (JSON. 取属性对象 (“openalltouch”)) 调试输出 (JSON. 取属性对象 (“processtype”)) 调试输出 (JSON. 取属性对象 (“appidStatuscode”)) 结果: 多层级解析 {
"code": 0,
"whwswswws": "ej7ltErOLmBq00vH-Cg2EFw",
"openall": 1,
"openalltouch": 1,
"processtype": 1,
"appidStatuscode": 0,
"grinfo": {
"name": "张三",
"age": 18,
"phone": "15601225588"
}
} 比如取grinfo内容 JSON. 解析 ( #INFO2, , )调试输出 (JSON. 取属性 (“grinfo”). 取属性对象 (“name”)) 调试输出 (JSON. 取属性 (“grinfo”). 取属性对象 (“age”)) 调试输出 (JSON. 取属性 (“grinfo”). 取属性对象 (“phone”)) 结果: 多层级带列表 { "code": 0, "whwswswws": "ej7ltErOLmBq00vH-Cg2EFw", "openall": 1, "openalltouch": 1, "processtype": 1, "appidStatuscode": 0, "grinfos": [{ "name": "项羽", "age": 18, "phone": "15601225588" }, { "name": "李斯", "age": 36, "phone": "15601225599" }, { "name": "赵高", "age": 20, "phone": "15601225566" }
} 比如还取grinfos内容 JSON. 解析 ( #INFO3, , )计次循环首 (JSON. 取属性 (“grinfos”). 成员数 (), i )name = JSON. 取属性 (“grinfos”). 取成员 (i - 1, ). 取属性对象 (“name”)age = JSON. 取属性 (“grinfos”). 取成员 (i - 1, ). 取属性对象 (“age”)phone = JSON. 取属性 (“grinfos”). 取成员 (i - 1, ). 取属性对象 (“phone”)调试输出 (name, age, phone )计次循环尾 ()结果:
|