$.ajax({
method: "GET",
url: "http://pokeapi.co/api/v2/pokemon?limit=151"
}).done(function(data) {
console.log(data);
});
在Chrome中运行良好。
Safari返回:
Failed to load resource: Request header field Cache-Control is not allowed by Access-Control-Allow-Headers.
XMLHttpRequest cannot load http://pokeapi.co/api/v2/pokemon/?limit=151. Request header field Cache-Control is not allowed by Access-Control-Allow-Headers.
我尝试过ajaxSetup beforeSend使“Cache-Control”无效。
有什么想法吗?
答案 0 :(得分:2)
您是否尝试将请求更改为https
而不是http
?这帮助我昨天,但我删除了我的缓存,无法找到我读过的mozilla文档。我会尝试找到它并发布它