【发布时间】:2010-09-30 00:01:17
【问题描述】:
无论出于何种原因,以下请求都没有得到 google 的响应。但是,如果我将 URL 粘贴到地址栏中,它可以正常工作。我不确定为什么会发生这种情况。谷歌是否通过引用标头过滤掉请求?
http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=3122%2C%20Australia
$.ajax({
url:'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address='+post_code+encodeURIComponent(', Australia'),
success:function(data) {
alert(data);
if(data['status'] == 'OK') {
var location = data['results'][0]['geometry']['location'];
map.panTo(location['lat']+':'+location['lng']);
map.setZoom(8);
}
}
});
【问题讨论】:
标签: javascript jquery google-maps google-maps-api-3