【发布时间】:2015-12-02 06:30:49
【问题描述】:
我有 main.html 页面,我正在调用 main.html 中的子页面,如下所示:
main.html
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<script type="text/javascript">
function getmyurl(url){
$('#mypageload').load(url);
}
</script>
<a href="javascript:void(0);" onclick="getmyurl('googlemap.htm');">google map</a>
<div id="mypageload">html page content will come to here like php include</div>
</body>
</html>
这适用于普通页面。但是谷歌地图(googlemap.htm)没有显示地图。我猜这里有问题:
google.maps.event.addDomListener(window, 'load', initialize);
我可以做些什么来解决问题?
googlemap.htm
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
</head>
<body>
<script>
function initialize() {
....
}
</script>
<div id="map-canvas"></div>
</body>
</html>
注意:我的英语不好,对不起。
【问题讨论】:
标签: html google-maps google-maps-api-3