0

此地图在 chrome 中完美运行,但在 IE 和 FF 中显示如下;

http://imgur.com/xuLVSUS

这是我的代码:

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;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>
4

1 回答 1

1

尝试

<script src="https://maps.google.com/maps?file=api&amp;v=2&amp;key=AIzaSyBTbIpaaV72BfdUL3aOSU8dER1oUaso79o"></script> 
                 ^

代替

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=AIzaSyBTbIpaaV72BfdUL3aOSU8dER1oUaso79o"></script>
于 2013-10-19T15:39:39.810 回答