Page loads in Firefox but not IE

I am using the Google Maps API to generate a map with a single KML file.  It works fine with Firefox, but displays a blank page when viewed in IE.  There are no errors displayed and this is the source that is shown in IE.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">

<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta charset="utf-8"/>
<title>Cumberland County LiveCAD Map</title>
<link href="css/styles.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
      function initialize() {
        var latlng = new google.maps.LatLng(43.83, -70.42);
        var mapOptions = {
          center: latlng,
          zoom: 10,
          mapTypeId: google.maps.MapTypeId.TERRAIN
        }

        var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
            var cadLayerOptions = {
              preserveViewport: true,
          };
        var cadLayer = new google.maps.KmlLayer('<url>', cadLayerOptions);
        cadLayer.setMap(map);
            }
      </script>
</head>
<body class="background" onload="initialize()">
      <div id="map_canvas" style="width:100%; height:100%; float:left"></div>
</body>
</html>
jmoran18251Asked:
Who is Participating?
 
GaryCommented:
That code doesnt work in FF,
You have a misplaced comma here which gives an error
preserveViewport: true,
0
 
BillBondoCommented:
Maybe this http://code.google.com/p/html5shiv/ will help. My site (HTML5) doesnt work on IE8 and earlier. But works on FF
0
 
srivenkyCommented:
I guess there is some issue with the doc type specified.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Open in new window


Remove the doctype from the file, the map is rendered both in IE & FF.

Also replace this code with yours (Comma removed)
 var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
            var cadLayerOptions = {
preserveViewport: true
          };

Open in new window

Sample.html
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
GaryCommented:
IE7 was the only browser it failed to load in and removing the comma as pointed out here
http://www.experts-exchange.com/Q_27832963.html#a38305603

...fixed that
0
 
GaryCommented:
Uh?
You don't remove the Doctype.
The error was the comma and the accepted answer just repeats what I said 3 days earlier.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.