28,390
社区成员
发帖
与我相关
我的任务
分享
<script language="JScript" runat="Server">
function toObject(json) {
eval("var o=" + json);
return o;
}
function toArray(s){
var dic = Server.CreateObject("Scripting.Dictionary")
eval("var a=" + json);
for(var i=0;i<a.length;i++){
var obj = Server.CreateObject("Scripting.Dictionary")
for(x in a[i]) obj.Add(x,a[i][x])
dic.Add(i, obj);
}
return dic
}
</script>
<%
Dim json
json ="[{'uid':'1','username':'abc','email':'123@163.com'},{'uid':'2','username':'dbc','email':'456@163.com'}]"
Set json = toArray(json)
For i=0 To json.Count-1
Response.Write json(i)("uid") & " <br/>"
Response.Write json(i)("username") & " <br/>"
Response.Write json(i)("email") & " <br/>"
Next
Set json = Nothing
%>