Javascript 谷歌地图不会显示在ie 8或9中

Javascript 谷歌地图不会显示在ie 8或9中,javascript,google-maps,Javascript,Google Maps,我不知道为什么它没有显示出来。我可以 我无法在ie 6-9中显示,有人有什么想法吗 我认为可能是javascript,但我不确定,JQuery是一个较旧的版本,所以我认为这不是问题所在 <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link rel="stylesheet" href="css/Style.c

我不知道为什么它没有显示出来。我可以 我无法在ie 6-9中显示,有人有什么想法吗

我认为可能是javascript,但我不确定,JQuery是一个较旧的版本,所以我认为这不是问题所在

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="css/Style.css" type="text/css" />

    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCOG1bujdUBiEwXHJZttZU1H87Zwd4HTRQ&sensor=false"></script>
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
    <![if !IE]>
    <script language="javascript" type="text/javascript" src="Path/to/excanvas.min.js"></script>
<![endif]>

    <script type="text/javascript">

var markerDisplay = [];
var iconDisplay = [];
var panelAddresses = [];
var zipGroup = 0;
var infowindow;

function initializeMap() {

    geoCoder = new google.maps.Geocoder();
    //address = document.getElementById("ID_txtDocters").value;
   var address = "United States, 85716";
   var lat = '';
   var lng = '';
   geoCoder.geocode({ 'address': address }, function (results, status) {
       if (status == google.maps.GeocoderStatus.OK) {
           lat = results[0].geometry.location.lat();
           lng = results[0].geometry.location.lng();

           var options =
           {
               zoom: Number(11),
               center: new google.maps.LatLng(lat, lng),
               mapTypeId: google.maps.MapTypeId.ROADMAP,
               mapTypeControl: true,
               mapTypeControlOptions:
               {

                   poistion: google.maps.ControlPosition.TOP_RIGHT
               },
               navigationControl: true,
               navigationControlOptions: {
                   style: google.maps.NavigationControlStyle.ZOOM_PAN
               },
               scaleControl: true,
               draggable: true,
               draggableCursor: 'move'
           };

           map = new google.maps.Map(document.getElementById('id_mapPanel'), options);
           zipcoder();

       } else {
           alert("Geocode was not successful for the following reason: " + status);
       }
   });
}

function zipcoder() {
try {
    var address = "85716";
    var panelDisplay = "";
    var iconName = "http://maps.google.com/mapfiles/markerA.png";

    var iconLetters = "BCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var letter = "A";
    iconName = "http://maps.google.com/mapfiles/marker" + letter + ".png";
    panelAddresses[zipGroup] = document.getElementById('id_officeLocation').innerHTML;
    markerDisplay[zipGroup] = "<a style='font-weight: bold; color: #000000;' >" + document.getElementById("id_imageOffice").innerHTML + "</a><br/>" + document.getElementById("id_officeLoc").innerHTML;
    iconDisplay[zipGroup] = iconName;
    letter = iconLetters[zipGroup];

    zipGroup = 0;
    delayGeoCode();

} catch(err){
alert(err.message)
}
}


function delayGeoCode() {
    if (zipGroup < panelAddresses.length) {
        geoCoder.geocode({ 'address': panelAddresses[zipGroup] }, addressResolved());
    }
}

function addressResolved(results, status)
{
    return function (results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            var marker = new google.maps.Marker({
                map: map,
                icon: iconDisplay[zipGroup],
                position: results[0].geometry.location,
            });
            (function (data, marker) {
                google.maps.event.addListener(marker, 'click', function () {
                    if (!infowindow) {
                        infowindow = new google.maps.InfoWindow();
                    }
                    infowindow.setContent(data);
                    infowindow.open(map, marker);
                });
            })(markerDisplay[zipGroup], marker);

            zipGroup = zipGroup + 1;
        } else {
            //alert("Geocode was not successful for the following reason: " + status);
        }
        window.setTimeout(delayGeoCode, 100);
    };
}




function providerBio(first, last){
    var windowFeatures = "status=0, toolbar=0, location=0, menubar=0, directories=0,scrollbars=1, left=0, height=405, width=810";

    window.open("providerPortrait.php?first=" + first + "&last=" + last, "", "width=930, height=465",windowFeatures);
}


window.onload = initializeMap();



    </script>

    </head>
<body>
    <?php 

        include("configDevelop.php");
        $result=0;
        $totalRows = 0;
        $Link = 0;
        $search_done = FALSE;
        $form_data["officeName"] = $_GET['first'];

        $Link = new mysqli(NMS_DB_HOST, NMS_DB_USER, NMS_DB_PASS, NMS_DB_NAME);
        if (mysqli_connect_errno()) {
            printf("Connect failed: %s\n", mysqli_connect_error());
            exit;
        }


        $query_where = 'WHERE ';

        if (strlen($form_data['officeName']) > 0)
            $query_where .= "OfficeName = '" . mysqli_real_escape_string($Link, trim($form_data['officeName'])) . "'";


        $query = <<<SQL
SELECT * FROM providers
$query_where
SQL;

            //echo $query;

        $result = $Link->query($query);

        if (!$result) {
            printf("Query failed: %s\n", $query);
            exit;
        }

        if($row = mysqli_fetch_array($result))
        {

            $ProvName =  $row['First']  . $row['Last'];
            $First = $row['First'];
            $Last = $row['Last'];
            $OfficeName = $row['OfficeName'];
            $Location = $row['StreetAddress'] . "<br/> " . $row['City'] . " " . $row['State']  . " " . $row['Zipcode']. "<br/> " . $row['Phone'];
            $Location2 = $row['StreetAddress'] . " " . $row['City'] . " " . $row['State']  . " " . $row['Zipcode'];
            $officeHours = $row['Hours'];
        }
        $search_done = TRUE;



    ?>

    <form id="form1">
    <?php include ("header.php"); ?>
    <div class="mainBodyProv1">
        <div class="mainBodyProv2">
            <table>
                <tr>
                    <td class="mainProviderCellLeft mainBodyCellLine">
                      <div id="id_imageOffice" class ="mainh3"><?php echo $OfficeName; ?></div>
                        <div class="mainBody3Content">
                           <div class="providerData1">
                                Location:
                            </div>
                              <div id = "id_officeLoc" class="providerData1 providerData2">
                                    <?php echo  $Location?>
                                </div> 
                                <div id=id_officeLocation class="imageTestVisible" ><?php echo  $Location2?></div>

                            <div class="providerData1">
                                Location Hours:
                            </div>
                            <div class="providerData1 providerData2">
                                    <?php echo  $officeHours?>


                            </div>
                                <br />

                            <div class="providerData1">
                        Providers:
                            </div>
                            <div >
                            <table class="providerData1 providerData2">
                                <tr>
                                </tr>
                            <?php
                                if($search_done)
                                {
                                      echo "<tr>";
                                      echo "<td class='providerCell'> <a style='text-decoration: underline' onclick='providerBio(" . "\"" .  $row['First'] . "\""  . "," . "\"" .  $row['Last'] . "\"" . ")'>" . $ProvName . "</a></td>";
                                      echo "</tr>";

                                    while($row = mysqli_fetch_array($result))
                                      {
                                      echo "<tr>";
                                      $ProvName =  $row['First']  . $row['Last'];
                                      echo "<td class='providerCell'> <a style='text-decoration: underline' onclick='providerBio(" . "\"" .  $row['First'] . "\""  . "," . "\"" .  $row['Last'] . "\"" . ")'>" . $ProvName . "</a></td>";
                                      echo "</tr>";
                                      }
                                      $result->close();
                                      $Link->close();

                                }else {
                                        echo "<tr>";
                                        echo "<td><center>No results.<center /></td>";
                                          echo "</tr>";

                                    }

                                ?>
                         </table>
                                                        </div>
                    </td>
                    <td class="mainOfficeLocCellRight">
                               <div id= "id_mapPanel" class= "mainOfficeLocContentRight" > </div>
                    </td>
                </tr>
            </table>

        </div>
    </div>

    <?php include ("footer.php"); ?>

    </form>
</body>
</html>

var markerDisplay=[];
var iconDisplay=[];
var panelAddresses=[];
var-zipGroup=0;
var信息窗口;
函数初始化映射(){
geoCoder=新的google.maps.geoCoder();
//address=document.getElementById(“ID\u txtDocters”).value;
var address=“美国,85716”;
var lat='';
var lng=“”;
geoCoder.geocode({'address':address},函数(结果,状态){
if(status==google.maps.GeocoderStatus.OK){
lat=results[0]。geometry.location.lat();
lng=results[0]。geometry.location.lng();
var期权=
{
缩放:数字(11),
中心:新google.maps.LatLng(lat,lng),
mapTypeId:google.maps.mapTypeId.ROADMAP,
mapTypeControl:true,
mapTypeControlOptions:
{
位置:google.maps.ControlPosition.TOP\u右
},
导航控制:对,
导航控制选项:{
样式:google.maps.NavigationControlStyle.ZOOM\u PAN
},
scaleControl:对,
真的,
DragableCursor:“移动”
};
map=new google.maps.map(document.getElementById('id\u mapPanel'),选项);
zipcoder();
}否则{
警报(“地理编码因以下原因未成功:“+状态”);
}
});
}
函数zipcoder(){
试一试{
var address=“85716”;
var panelDisplay=“”;
变量iconName=”http://maps.google.com/mapfiles/markerA.png";
var iconLetters=“bcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvxyz123456789abcdefghijklmnopqrstuvxyz12345678abcdefghijklmnopqrstuvxyz”;
var letter=“A”;
iconName=”http://maps.google.com/mapfiles/marker“+字母+”.png”;
panelAddresses[zipGroup]=document.getElementById('id_officeLocation').innerHTML;
markerDisplay[zipGroup]=“document.getElementById(“id_imageOffice”).innerHTML+”
“+document.getElementById(“id_officeLoc”).innerHTML; iconDisplay[zipGroup]=iconName; 字母=iconLetters[zipGroup]; zipGroup=0; delayGeoCode(); }捕捉(错误){ 警报(错误消息) } } 函数delayGeoCode(){ if(zipGroup 一定是

window.onload = initializeMap;

IE错误控制台中是否显示任何错误?是。如果您单击提供商地址,该链接将带您进入office locations页面。在那里我得到了一个错误:网页错误详细信息用户代理:Mozilla/4.0(兼容;MSIE 8.0;Windows NT 6.0;Trident/4.0;SLCC1;.NET CLR 2.0.50727;.NET CLR 3.5.30729;.NET CLR 3.0.30729;.NET CLR 3.0.30729)时间戳:2014年3月31日星期一19:10:44 UTC消息:预期标识符、字符串或数字行:96字符:13代码:0 URI:Burgess,但是,当我看代码时,一切看起来都很好。如果浏览器有调试页面的工具,请使用它们(第96行中有一个尾随逗号),你们会喜欢的。非常感谢。:)
window.onload = initializeMap;