【发布时间】:2014-03-30 16:29:28
【问题描述】:
我是 JSON 和谷歌地图的新手。所以请告诉我我错过了什么
<!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>
【问题讨论】:
标签: jquery json google-maps-api-3