我正在尝试使用Google Geocoder API为我提供在Google Places API中使用的经度和纬度。首先,我该如何编码API的URL,以便返回JSON字符串?我认为这将是一个像jQuery的负载,但这并不奏效。所以我有这个不错的url,它返回我需要的信息,但只是转储了一堆json数据。我如何捕获数据?Google API响应JSON
http://maps.googleapis.com/maps/api/geocode/address=12308&sensor=false
function loadScript() {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://maps.googleapis.com/maps/api/geocode/address=12308&sensor=false";
document.body.appendChild(script);
resultjson = script
console.log(resultjson);
}
我不认为谷歌地理编码API有一个JSONP访问方法,这将需要这样的工作。 – Pointy 2012-01-02 22:48:57