これから
$.ajax(
{
type: 'post',
dateType: 'json',
url: '<?php echo base_url(); ?>buyer/get_address',
data: { data: $id },
success: function (resp) {
alert(resp); //retuns whole result
alert(resp.address_id); //returns undefind
}
})
ブラウザコンソールでこれを取得します:
{
"address_id": "10",
"user_id": "81",
"address_as": "wholesale",
"receiver_name": "Karamjeet Singh",
"address": "street no 1,",
"zip_code": "11111111",
"phone": "222222222222",
"province": "14",
"regency": "Bali",
"sub_district": "",
"status": "1",
"created": "28 Oct 2013 , 11 : 06 : 06 am",
"updated": "28 Oct 2013 , 11 : 06 : 06 am"
}
個々の変数にある応答に従ってすべてのデータにアクセスする方法を誰か教えてもらえますか?