I have a json object in the following format
{
"class": "model",
"valueDataArray": [
"category": "supply",
"const": "123"
},
{
"category": "prod",
"text": "specify"
}
],
"LinkArray": [
{
"from": 1,
"to": 2
},
{
"from": 2,
"to": 3
}
]
how can i get the values in valueDataArray? please Help
data = JSON.parse(data);
alert(data.valueDataArray.category);
I assume that you are using jquery then use
data = $.parseJSON(data);
alert(data.valueDataArray.category);
You can use native JSON.parse() method. Also your JSON need to be fixed. Here is a working example (with JSON fixed)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.