我正在尝试使用ajax请求从我的本地域重定向到paypal结帐域。我也允许跨域为true.but我收到错误
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
我的代码是:
$.ajax({
type: 'GET',
url: ' https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-2YA61167F0197144Y',
processData: false,
crossDomain: true,
contentType: "application/json",
jsonp: false,
success: function() {
alert("Success");
},
error: function() {
alert("failure");
}
});