Hello All,
I have been able to execute AJAX and JSON successfully in the past however I am struggling with the following JSON and not sure what I am doing wrong. For the given JSON
{
"invoices": {
"INV123589": {
"custname": "Customer A",
"total": "$100"
},
"INV123554": {
"custname": "Customer B",
"total": "$200"
}
}
}
I am trying to parse it via an ajax call:
$.ajax({
url: 'someurl',
type: 'GET',
dataType: 'json',
success: function(data){
alert(data.length);
alert(data.invoices.length);
alert(data[0].length);
});
The ajax executes however all the alert messages are coming up as null. I am interested in retreiving the invoice number, example INV123589, and its customername and total. Any help in this matter will be greatly appreciated