【发布时间】:2014-03-25 07:23:11
【问题描述】:
我正在尝试使用 ajax 请求从我的本地域重定向到 Paypal 结帐域。我也允许跨域为 true。但我收到了错误
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
我的代码是:
$.ajax({
type: 'GET',
url: url,
processData: false,
crossDomain: true,
contentType: "application/json",
jsonp: false,
success: function() {
alert("Success");
},
error: function() {
alert("failure");
}
});
【问题讨论】: