I'm building both an application and the server (unfortunately on different domains)
On the application I have:
$.ajax({
url: BASE_URL + "api/create",
type: "get",
async: false, // why do I need this
dataType: "jsonp",
data: {
"auth_token": "cBQHASwKszsW4e75unK6"
},
error: function(error) {
alert(JSON.stringify(error));
},
success: function(data) {
alert(data);
}
});
I know that the server is returning (when I go to it in a browser):
jQuery1910041686943266540766_1365730282085({"error":"User does not exist","status":400})
(which is correct data)
However, the ajax request fails and is listed as status "failed" and type "pending"
I'm not sure what's going on here
I have also tried:
$.getJSON(BASE_URL + "api/create?auth_token=cBQHASwKszsW4e75unK6&callback=?", function(data) {
alert(JSON.stringify(data));
});
which also failed