【发布时间】:2015-08-12 20:01:37
【问题描述】:
我应该如何从这个 JSON 中检索 PitcherID?我正在使用来自http://aspjson.com 的课程。
JSON
[
{
"PitcherID": "456068"
},
{
"PitcherID": "431148"
}
]
代码
oJSON.loadJSON("...")
For Each thing In oJSON.data("PitcherID")
Set this = oJSON.data("PitcherID").item(thing)
response.write this.item("PitcherID")
Next
错误
Microsoft VBScript runtime error '800a01c3'
Object not a collection
【问题讨论】:
-
错误是告诉你你试图作为一个集合读取的对象我猜是
oJSON.data("PitcherID")inFor Each thing In oJSON.data("PitcherID")不是一个集合对象,在这种情况下PitcherID不是' t 如果您查看 JSON 结构。
标签: json object collections vbscript asp-classic