Reputation: 3521
I have one jsonfile as follows.
data.json:
[{
"id": "plot"
},
[
[195, 200, 0.3],
[196, 196, 1],
[196, 197, 0.9],
[196, 198, 0.1]
]
]
I am trying to parse the title of jsonusing following code.
code:
$.getJSON('data.json', function(data) {
var obj = JSON.parse(data);
alert(obj.id);
});
But i get no output while using above code?
Upvotes: 0
Views: 404
Reputation: 5571
Try with:
obj[0].id; // Array of object.
Upvotes: 2