But later, when used, found a problem, if the JSON is simple, there is no problem, if the JSON contains an array, because the VBS is not directly referencing the elements of the array in JS, so the array elements in the JSON object can not be accessed. Tried a lot of ways, pop, and so on, No. Search the net again, also have no fruit.
Depressed for a long time, instead of searching "VBScript how to access JavaScript array", I found a foreigner article. After debugging, found the foreigner's method is good. The reason for not being able to access is that the corresponding get method is not defined. Instead, join him in the get indexer, try it, OK.
The code is as follows:
ASP JSON parser
Code
Copy Code code as follows:
<script language= "javascript" runat= "Server" >
Array.prototype.get = function (prop)
{
return This[prop];
}
function Parsetojson (json_data)
{
Eval ("var o=" + json_data);
Return (o);
}
</script>