$("#tog1").on("click",function(){
var _data= {
'mixMobile':'1212121212121'
};
$.ajax({
type : "post",
url : "Access-Control-Allow-Origin:http://crawler01.chinacloudapp.cn:8000/ListerineTmall/BindQueryCustomerServlet",
data : JSON.stringify(_data),
contentType : "application/json",
dataType : "json",
async: true,
error:function(msg) {
console.log(msg);
},
success:function(msg) {
console.log(msg);
}
});
});
这是error的日志 :readyState: 4, responseJSON: undefined, status: 404, statusText: "error"}
Access-Control-Allow-Origin:需要在加载地址的服务器端设置,你在url中写有什么用?
如php是
header('Access-Control-Allow-Origin:*');
url : "Access-Control-Allow-Origin:http://crawler01.chinacloudapp.cn:8000/ListerineTmall/BindQueryCustomerServlet改成
url : "http://crawler01.chinacloudapp.cn:8000/ListerineTmall/BindQueryCustomerServlet
Access-Control-Allow-Origin:需要在加载地址的服务器端设置****
404请求资源不存在,你看下请求地址是不是有问题
1.处理404,先把网址使用postman或者其他类似工具测试一下
2.跨域服务端设置即可
404资源找不到,你的请求路径url有问题啊