I created a jsonp ajax call for getting data via cross domain. The thing right now is - I successfully manipulated it to send data over a webserver.
But it fails receiving data in a get call. When I have look in the debugger I see that the network tab receives the file and within there is the data. But I still get an error message.
The url gets a parameter with the jquery callback key. My webservices uses that key and adds it again in the response header. (which I also see in the debugger). I also receive a OK
200
status code in the network tab that the data is received...
The question now is why the ajax call doesn't jump into the success function but shows me everytime the error that the callback isn't called.
What do I do wrong?
The code looks like this:
$.ajax({
url: getServicePath,
dataType: 'jsonp',
username: "abc",
password: "123",
contentType: "application/json",
success: function(results) {
alert(results);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("Status: " + textStatus); alert("Error: " + errorThrown);
}
Thanks for your help!! :)