【发布时间】:2017-10-23 23:45:52
【问题描述】:
我正在尝试使用 url 查询 Google Geocode API
http://maps.google.com/maps/api/geocode/json?address=00000
我期待类似的结果,并在我的浏览器和 SoapUI 等 3rd 方工具中收到此结果。
{
"results" : [],
"status" : "ZERO_RESULTS"
}
但是,当我使用 JQuery 和 Ajax 查询地址时...
var googleAPI = "http://maps.google.com/maps/api/geocode/json?";
var addressCombined = "address=" + jQuery('#ZipCode').val();
alert(addressCombined);
$.getJSON(googleAPI,
{
address: addressCombined
})
.done(function(data) {
alert(googleAPI + addressCombined);
alert(JSON.stringify(data));
}
.fail(function(error) {
alert("no");
console.log("ERROR");
console.log(error);
});
我在罗德岛找了一个地方。知道为什么吗? 这是一些截图
【问题讨论】:
标签: jquery ajax google-maps-api-3