window.MyCallback = function (data) {
console.log(data);
};
$(document).ready(function() {
$.ajax({
type: 'GET',
url: 'http://xxx.xxx.xxx.xx/MyService/Service.svc/MyMethod',
contentType: 'application/jsonp',
crossdomain: true,
dataType: "jsonp",
data: { 'username': 'Jack' },
crossDomain: true,
jsonpCallback: 'MyCallback',
success: function (txt) {
console.log(txt);
},
error: function (xhr, status, err) {
console.log(status, err);
}
});
});
호출되지 콜백 다음 "MyCallback"함수를 호출 들어 MyCallback was not called.
jQuery를 아약스 요청 오류 : 난 항상 오류 얻을
이 추가 되었습니까? – byJeevan