This is my function:
$.ajax({
url: 'http://ec2-52-202-201-59.compute-1.amazonaws.com:8080 /receipts',
dataType: 'application/json',
complete: function(data){
console.log(data)
},
success: function(data){
alert(data)
}
});
The function never goes on success, and the object that is included in data is the following:
Object { readyState: 0, getResponseHeader: getResponseHeader(), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(), overrideMimeType: overrideMimeType(), statusCode: statusCode(), abort: abort(), state: state(), always: always(), catch: catch(), 8 more… }
If I go on my browser at that link I can see the JSON files. Similarly, If I go in my console, the GET request is done, and I can see in the response body the JSON objects that I need.
Why it the Ajax call doesn't work?