标签:lan type function ons amp func asp ext 方法
<%
Dim json, obj
json = "{a:""aaa"", b:{ name:""bb"", value:""text"" }, c:[""item0"", ""item1"", ""item2""]}"
Set obj = parseJSON(json)
Response.Write "原JSON字符串是:<br>"
Response.Write json
Response.Write "<hr>"
Response.Write "a=" & obj.a & "<br />" ‘结果是aaa
Response.Write "b=" & obj.b.name & "<br />" ‘结果是bb
Response.Write "c.length=" & obj.c.length & "<br />" ‘结果是3
Response.Write "c.get(0)=" & obj.c.get(0) & "<br />" ‘结果是item0
Set obj = Nothing
%>
<script language="jscript" runat="server">
Array.prototype.get = function(x) {
return this[x];
};
function parseJSON(strJSON) {
return eval("(" + strJSON + ")");
}
</script>
标签:lan type function ons amp func asp ext 方法
原文地址:https://www.cnblogs.com/zengkun983/p/9734523.html