AJAX request was successfully sent to php server and also inserted records on my oracle database. I cannot get the JSON response in success, error, complete callback functions.
I can't also see any logs on console.log
I am using codeigniter and my php server was on model folder and it returns an json formatted string.
echo json_encode(array("Response"=>99,"Value"=> $result));
Here is my ajax code:
$.ajax({
url: 'url/functionhere',
type: 'post',
dataType: 'json',
data: {
"STUDID": studId,
"LASTNAME": lastName,
"FIRSTNAME": firstName,
"MIDINITIAL": midInitial,
"BIRTHDAY": birthday,
"AGE": age,
"GENDER": 'M'
},
success: function (data) {
if (data.Response == 99) {
alert(data.Value);
console.log("putek");
}
},
error: function (header, status, error) {
console.log('ajax answer post returned error ' + header + ' ' + status + ' ' + error);
},
complete: function () {
console.log("putek");
}
});