请求的ajax这样写的。不是mui.ajax自带跨域功能吗?为什么还会报一个跨域的错误
mui.ajax('http://app.veishu.com/jsonp/courses/all.js', {
data: {
mobile: phone
},
dataType: 'json',
type: 'POST',
timeout: 10000,
success: function(data) {
alert(data);
},
error: function(xhr,type,errorThrown) {
console.log(type);
}
});
XMLHttpRequest cannot load http://app.veishu.com/jsonp/courses/all.js. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.1.13:8020' is therefore not allowed access.
gaus
chrome测试OK,高!
一点疑问:
1、debug发现已经从server获得了正确的json数据,为啥浏览器还会报错呢?
2、另外firefox有无解决办法?
多谢!
2015-09-02 09:46