Closed Wizard2k closed 7 years ago
Hi.
When you parse the string that represents an array into a json object, the parse method returns the array instance that is created in the neon object.
You don't need to push it to a new JSON array.
<%
'...
Set arrJson = myJson.parse(sString)
for each item in arrJson.items
if isObject(item) and typeName(item) = "JSONobject" then
Response.Write "<br>item " & item.value("IdUser")
else
response.write item
end if
response.write "<br>"
next
%>
Hi Ricardo! It works! Thank you very much!
Hi guys, I have a problem using JSON array, or better open a serialized JSON Array
This is the story: A procedure load data into json object like this:
If I do a Response.Write of sString is:
[{"IdUser":1,"Name":"Aldo"},{"IdUser":2,"Name":"Manuela"}]
Now I try to load this Json into a new Json object:
My question is: How can I load an JSON Array and loop into it? The for each loop provide me nothing (and also seems that only one time it goes into loop)
Another thing: If I do a myJson.Write the class print this:
{"data":[{"IdUser":1,"Name":"Aldo"},{"IdUser":2,"Name":"Manuela"}]}
Adding "data" before the json array
Can anyone help me?