在百度地图API抄了一个网页,在本地磁盘上使用IE能够打开地图;
上载到服务器在打不开,firefox、safari、chrome等都没有问题。据说是IE设置问题,到底是哪里呢?
html如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JSAPI与URLAPI结合示例</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=b2GhWwO8fpGfZO7rKmvRTDzA"></script>
<style type="text/css">
html,body{
width:400px;
height:300px;
margin:0;
overflow:hidden;
}
</style>
</head>
<body>
<div style="width:400px;height:300px;border:1px solid gray" id="container"</div>
</body>
</html>
<script type="text/javascript">
var map = new BMap.Map("container");
map.centerAndZoom(new BMap.Point(116.403884,39.914887), 13);
map.enableScrollWheelZoom();
var marker=new BMap.Marker(new BMap.Point(116.403884,39.914887));
map.addOverlay(marker);
</script>