解决方案如下:
1、ie9以下兼容ajax跨域访问
2、ajax请求开始前添加 jQuery.support.cors = true; 允许跨域
3、ie浏览器设置允许通过域访问数据 并且 url为http协议。(设置=>Internet选项=>安全=>自定义级别=>允许通过域访问数据(设置启用))
示例:
jQuery.support.cors = true;
$.ajax({
type: "GET",
// cache: false,
data: {
},
url: url, //请求地址
dataType: "json",
success: function(res) {
console.log(res)
},
error: function(err) {
console.log(err)
}
});