【发布时间】:2019-04-26 17:17:32
【问题描述】:
我不知道如何在经典 asp 中遍历这个 json:
{"recs":
[
{"0":
{
"idOrder":"1",
"idProduct":10,
"description":
"prod 10",
"orgweight":5,
"newweight":5,
"rootsku":"sku1",
"size":"12-18 Months"
},
"1":
{
"idOrder":"2",
"idProduct":20,
"description":"prod 20",
"orgweight":5,
"newweight":5,
"rootsku":"sku2",
"size":"12-18 Months"
}
}
]
}
sub updateWeights()
dim jsonOBJ : set jsonOBJ= JSON.parse(join(array(myJsonString)))
For Each rec in jsonOBJ("recs")
'I want to compare orgweight vs newweight and update the db accordingly
Next
end sub
我错过了什么?这不是在 Classic ASP 中遍历 JSON 对象的正确方法吗?
【问题讨论】:
标签: json foreach asp-classic