0
我是新来的两个JSON &谷歌地图。jQuery getJSON()不能与谷歌地图API
$(function() {
$("#search").click(function() {
$.getJSON("http://maps.googleapis.com/maps/api/geocode/json?address=awan%20town&sensor=false", function (result) {
$.each(result, function (i, field) {
$.("#map-canvas").append(field + " ");
});
});
});
});
:所以,请告诉我,我很想念
<!DOCTYPE html>
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3.15&sensor=false"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$function({
$("#search").click(function(){
$.getJSON("http://maps.googleapis.com/maps/api/geocode/json?address=awan%20town&sensor=false",function(result){
$.each(result,function(i,field){
$("#map-canvas").append(field + " ");
});
});
});
});
</script>
</head>
<body>
<button id="search">Search</button>
<div id="map-canvas" style="width:100%;height:100%;"></div>
</body>
</html>
这里还没有工作 –
你想从返回的JSON中获得什么字段? – Felix
我想我写的代码会从这个URL返回所有的,我真的想得到任何特定的领域如何做到这一点 http://maps.googleapis.com/maps/api/geocode/json?address=awan%20town&sensor = false –