Closed tbett closed 8 years ago
The JSONobject class has a property named pairs
that let's you access directly the property pairs.
<%
dim props, prop
props = json.pairs
for each prop in props
response.write prop.name & ":" & prop.value & "<br>"
next
%>
So, just to be complete for others. Thanks again!
<%
dim vJson, json, props, prop
vJson = "{""prop1"":""value1"", ""prop2"":""value2"", ""prop3"":""value3""}"
set json = new JSONobject
json.parse(vJson)
props = json.pairs
for each prop in props
response.write prop.name & " : " & prop.value & "<br>"
next
%>
How do you loop through the available (unknown) properties to retrieve the property name and associated value ...
string = [{"prop1":"value1", "prop2":"value2", "prop3":"value3"}]
Thank you!