46
rated 0 times
[
48]
[
2]
/ answers: 1 / hits: 28197
/ 12 Years ago, wed, may 9, 2012, 12:00:00
Possible Duplicate:
JSON to javaScript array
Can anybody point me out how i can convert a json data to an array using java script in order to draw a chart from de data.
The JSON is structured as follows:
{
d:{
results:[
{
_metadata:{
uri: http://www.something.com/hi,
type : something.preview.hi
}, Name, Sara, Age: 20, Sex : female
},
_metadata:{
uri: http://www.something.com/hi,
type : something.preview.hi
}, Name, James, Age: 20, Sex : male
}
]
}
}
I would like to convert this jason to the following format:
var sampleData = [
{ name: 'Sara', Age: 20, Sex: 'female'},
{ name: 'James', Age: 20, Sex: 'male'}
];
Does anyone have any advice on how to achieve this?
More From » json