有段JSON是数组形式,我用ASP怎么获取其中的每个值 30
JSON值比如:{"status":{"code":"1"},"info":{"shuliang_total":"3"},"shuliang":[{"id":"12445...
JSON值比如:
{
"status": { "code":"1"},
"info": {"shuliang_total":"3"},
"shuliang": [
{"id":"124452","name":"A","type":"yifu",},
{"id":"543322","name":"B","type":"kuzi",},
{"id":"454352","name":"C","type":"waizi",},
(还有很多shuliang的值)
]
}
<script language="jscript" runat="server">
Array.prototype.get = function(x) { return this[x]; };
function parseJSON(strJSON) { return eval("(" + strJSON + ")"); }
</script>
ASP:
我现在用Set obj = parseJSON(strjson)读取这段
现在可以用obj.status.code获取值
但是我要获取shuliang里的每一项值,请问怎么获取。 展开
{
"status": { "code":"1"},
"info": {"shuliang_total":"3"},
"shuliang": [
{"id":"124452","name":"A","type":"yifu",},
{"id":"543322","name":"B","type":"kuzi",},
{"id":"454352","name":"C","type":"waizi",},
(还有很多shuliang的值)
]
}
<script language="jscript" runat="server">
Array.prototype.get = function(x) { return this[x]; };
function parseJSON(strJSON) { return eval("(" + strJSON + ")"); }
</script>
ASP:
我现在用Set obj = parseJSON(strjson)读取这段
现在可以用obj.status.code获取值
但是我要获取shuliang里的每一项值,请问怎么获取。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询