Firefox似乎阻止了此请求,而Chrome正在处理它。我做错了什么?
http://jsfiddle.net/e8qu2g9j/1/
$.ajax({
url: "http://maps.googleapis.com/maps/api/geocode/json",
data: {
bounds: "-35.2545,149.4947|-31.9955,152.5728",
region: "au",
components: "country:AU|administrative_area:NSW",
address: "Central Station"
}
});
我尝试添加:
crossDomain: true,
xhrFields: {
mozAnon: true,
mozSystem: true
},
但无济于事。
Firefox 31.0一直在给我:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://maps.googleapis.com/maps/api/geocode/json?bounds=-35.2545%2C149.4947%7C-31.9955%2C152.5728®ion=au&components=country%3AAU%7Cadministrative_area%3ANSW&address=Central+Station. This can be fixed by moving the resource to the same domain or enabling CORS.
编辑:这对我来说在新的Firefox配置文件中运行正常,但不是我的主要版本。我可以改变什么设置?