我使用 jQuery 调用跨域 Web 服务。来自本地主机的 Web 服务调用成功完成,在从其他域调用时,我收到 HTTP 302 状态代码错误。
这是网络服务调用;
$.ajax({
type: "POST",
url: "http://wthdevsr01:45452/webservices/GetUserAcceptancePolicyStatus.asmx/GetAcceptancePolicyReadStatus",
data: '{"userID" : \"' + $.trim(userID) + '\", "documentID" : \"' + $.trim(documentID) + '\"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result) {
if (result.d != '') {
if (result.d == '1') {
alert("ACCEPTED");
}
else if (result.d == '0') {
alert("NOT ACCEPTED");
}
else {
alert(result.d);
}
}
},
error:function (result) {
alert('Service call failed: ' + result.status + '' + result.statusText);
}
});
我想知道问题出在哪里?有任何想法吗?