I have a asp.net web service that returns a multi-level array.
the json string is parse using the json2.js lib :
var donnee = JSON.parse(msg.d);
the 1st level parsing is ok but the 2nd level array (data) remains as an array of objects
? donnee[0]
{...}
color: "#0000CD"
data: [[object Object],[object Object]]
label: "formol"
type: "traitement"
? donnee[0].data
[[object Object],[object Object]]
[0]: {...}
[1]: {...}
? donnee[0].data[0]
{...}
_l: ""
_x: 7
_y: 25
whereas I need an array of data e.g.
? donnee[0]
{...}
label: "traitement formol 2"
type: "traitement"
color: "#0000CD"
data: [7,25,,7,40,formol]
? donnee[0].data
[7,25,,7,40,formol]
[0]: [7,25,]
[1]: [7,40,formol]
? donnee[0].data[0]
[7,25,]
[0]: 7
[1]: 25
[2]: ""
what is the best way to decode/parse all the levels of the json string at once ?
best regards