How do I access the returned JSON Data? e.g the name array? to work
JSON…
{"COLUMNS":["NAME"],"DATA":[["Item 1"],["Item 2"]]}
The data.NAME[1] doesn’t seem to have any data in it..
$.getJSON('url/json.php',
function(data){
$('#debug').html('data:' + data.NAME[1]);
});
});
Parsing your JSON string
will return a javascript object like:
so there is no identifier for
data.NAME[1].You may access
data.COLUMNS[0]returning"NAME"ordata.DATA[0][0]returning"Item 1".