I am encountering an issue with a nested JSON structure.
JSON:
[{"id":"15",
"rand_key":"",
"landlord_name":"Shah",
"property_req_1":{
"lead_req_id":"",
"lead_id":"0",
"category_id":"1",
"region_id":"1",
"area_location_id":"17",
"sub_area_location_id":"3447",
"min_beds":"1",
"max_beds":"",
"min_budget":"3332",
"max_budget":"0",
"min_area":"",
"max_area":"0",
"unit_type":"2",
"unit_no":"",
"listing_id_1_ref":"RH-R-17",
"listing_id_1":"17"
}
}]
Code:
var json=null;
$.getJSON("ajax_files/getSingleRow_leads.php?id="+id, function(json){
json = json[0];
When I execute alert(json.property_req_1);
, it returns [object Object]
if(json.property_req_1){
var getReq = jQuery.parseJSON('['+json.property_req_1+']');
$.each(getReq, function(id, key) {
I am unable to access the data at this point
});
}
});
What could be causing this issue?