I am having a problem loading a google map v3 in Internet explorer 9. Chrome and Firefox load it perfectly, but IE9 doesn’t show it at all. I have this function:
function load() {
var map = new google.maps.Map(document.getElementById("mapa"), {
center: new google.maps.LatLng(44.109742, 20.462222),
zoom: 7,
mapTypeId: 'roadmap'
});
which I am calling here:
<body onload="load()">
At the beginning of my page I have an “if” clause which recognizes browsers:
<?php if ( preg_match( '/MSIE/i', $_SERVER['HTTP_USER_AGENT'] ) ) { ?>
<link href="CSS/stylemapaIE.css" rel="stylesheet" type="text/css" />
<?php } elseif ( preg_match( '/Firefox/i', $_SERVER['HTTP_USER_AGENT'] ) ) { ?>
<link href="CSS/stylemapaMF.css" rel="stylesheet" type="text/css" />
<?php } else { ?>
<link href="CSS/stylemapa.css" rel="stylesheet" type="text/css" />
<?php } ?>
and uses three different css stylesheets. You can see the page at http://jedanzasve.rs/Test/mapaponuda.php Any thoughts?
The map loads for me in IE9 (Browser Mode: IE9), as well as in Chrome. However you do have some
undefinedvariables cropping up in the console. This suggests to me that you have not properly referenced all of your resources, or you have not referenced them in the proper order. Of course another possibility is that you’re simply working off cached files.Clear your cache, double-check your resources, and their dependencies.