在使用React的时候,在componentDidMount 中使用jsonp跨域的方式,在pc上正常,但是在安卓手机上,不执行ajax中 success的方法 也不执行error的方法。通过查日子 发现ajax是请求成功了的。
componentDidMount() {
// alert($)
var that = this;
$.ajax({
url:"https://external.li_anchor_list.fcgi?page=1&pid=0&ver=1.0.1",
dataType:"JSONP",
type:"GET",
async:false,
success:function(backData){
alert(`ajaxOK`);
},
error:function(a,b,c){
alert(b);
}
});
不执行success 也不执行error的方法。 这是为什么?