I'm doing a JSON request, which returns me the results, but not the date, but rather the ajax error.
var url = window.location;
var id = url.toString().split("=")[1];
var msg = '';
$.ajax({
type: 'POST',
url: 'load-data.php?id='+id,
dataType: 'json',
success: function(data) {
msg = data;
alert(msg)
},
error:function(e){
console.log(e)
}
});
I just do not understand why the result appears in the ajax error.