此地图在Chrome中完美运行,但在IE和FF中显示如下;
这是我的代码:
<script src="http://maps.google.com/maps?file=api&v=2&key=AIzaSyBTbIpaaV72BfdUL3aOSU8dER1oUaso79o"></script>
<script type="text/JavaScript">
//<![CDATA[
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function')
{
window.onload = func;
}
else
{
window.onload = function()
{
if (oldonload)
{
oldonload();
}
func();
}
}
}
addLoadEvent(load);
//]]>
</script>
<div id="map" style="width:970px; height:600px; border: 1px solid #000; margin:0 auto;" ></div>
答案 0 :(得分:1)
尝试
<script src="https://maps.google.com/maps?file=api&v=2&key=AIzaSyBTbIpaaV72BfdUL3aOSU8dER1oUaso79o"></script>
^
而不是
<script src="http://maps.google.com/maps?file=api&v=2&key=AIzaSyBTbIpaaV72BfdUL3aOSU8dER1oUaso79o"></script>