I am trying to get the data from the array in foreach . I am sending a ajax get request to php file and get response with json & array. But when I try to print what inside the array its broke..
My JS code:
var url = $("#url").val();
var type = 'F';
var data_url = url + "manage/sources/ajax/ajax.php?type=GetBarber&gender=" + type ;
$.ajax({
type: "GET",
url: data_url,
dataType: "json",
success: function (response) {
// response returning - > {"status":"success","data":["name541","name214"]}
var json_obj = $.parseJSON(response);
for (i=0; i < json_obj.data.length; i++)
{
var payment = json_obj.data[i];
console.log(payment); // Just for debugging
}
}
});
I am trying to print what inside the data (names..) Thank you for help