I have the following JSON file below:
{"myArea":[{
"name": "ny 01",
"data": [63]
}]}
I use the code below to retrieve the data:
$(document).ready(function () {
$.getJSON('area.json',function(area){
console.log(area[0][0]);
});
});
However the data is not being retrieved. Console log says [object object] or undefined name when trying console.log(area[0])
or console.log(area[0].name)
. What is the proper way to access the data?