I have this JSON data:
[{"sequence":"503","accountnumber":"0001","telephonenumber":null,"emailaddress":"email@domain.com","directdebit":"Y","auto_directdebit":"","billing_address":{"title":"Mr","forename":"Joe","surname":" Bloggs","address1":"ADDR1","address2":"","address3":"","town":"TOWN","county":"COUNTY","postcode":"PC","country":"United Kingdom","default_invoice":"1","default_delivery":"1"}}]
And I use the following to retrieve the details:
$.ajax({
type: "GET",
url: "/section/get_data?getCustomer=1&sequence=" + $("#customersequence").val(),
data: $(this).serialize(),
success: function(data) {
alert(data[0].accountnumber);
}
});
which works but i cannot figure out how to return billing_address
i have tried:
data[0].billing_address[0].address1
but that did not work
how can i retrieve each field under billing_address