I am trying to retrieve values from a simple JSON file.
I can get the first value: total but when it comes to model and processorSpeed i'm stuck. Can someone help me please.
<%
Response.LCID = 2057
%>
<!--#include file="jsonObject.class.asp" -->
<%
Dim jsonString
jsonString = "{ ""total"": 1 , ""results"":[{""model"":""MacBook Pro"",""processorSpeed"":""2.6 GHz""}]}"
Dim jsonObj, outputObj
set jsonObj = new JSONobject
set outputObj = jsonObj.parse(jsonString)
response.write("<li> total :" & outputObj("total") & "</li>")
response.write("<li> model :" & outputObj("results.model") & "</li>")
response.write("<li> processorSpeed :" & outputObj("results.processorSpeed") & "</li>")
%>
Output I get:
total :1
model :
processorSpeed :
Thanks