一直报错Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
这是代码
mui.ajax('http://fanfou.com/public/mobile/company/nearbyList',{
data:{
latitude:'113.352425',
longitude:'23.137466'
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:10000,//超时时间设置为10秒;
headers:{'Content-Type':'application/json'},
success:function(data){
console.log(data)
},
error:function(xhr,type,errorThrown){
//异常处理;
console.log(type);
}
});
n***@qq.com (作者)
这个是官方示例。。。也报错。实在费解啊
2017-04-14 11:36