I'm trying to implement a jsonp function but I'm getting a 401 response,
code on website1:
goaap: function () {
$.ajax({
Authorization: '',
type: 'GET',
url: 'http://www.wedsite2.com/global/js/live.js?callback=goaa',
async: false,
contentType: "application/json; charset=utf-8",
dataType: 'jsonp',
success: function (msg) {
//do something
}
});
},
code on website2:
goaa: function () {
var request = null;
while (request === null) {
request = $.ajax({
url: "default.aspx/goaa",
data: '{AID: "' + $('#details').data('aid') + '"}',
dataType: 'json',
type: "POST",
contentType: "application/json; charset=utf-8"
});
}
return request;
},
I have looked at a number of examples and they suggest the jsonp implementation is straight forward, have I missed something in my implementation which is causing the 401 response?
Extra information from firebug:
Response:
{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}
JSON:
Message "There was an error processing the request." StackTrace "" ExceptionType ""
Post: JSON: AID "-1" Source: {AID: "-1"}