报错:
No 'Access-Control-Allow-Origin' header is present on the requestedresource. Origin 'http://127.0.0.1:8020' is therefore not allowed access. The response had HTTP status code 503.
方法:
$.ajax({
type:"post",
url:dataUrl.addDeliveraddress,
dataType:"json",
data:str,
statusCode:{
200:function(data){
alert("成功");
},
404:function(data){
alert("404");
},
503:function(){
alert("添加失败");
},
}
});
只能判断200或者404,503跟本抓取不到求解决
这是报的跨域错误