Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Issues with IE11 not displaying maps WordPress

  • SOLVED

Please check https://www.mapsmarker.com/dev/pro/ - in contrast to other browsers not all but only the first two maps are displayed. IE11 shows a syntax error in the console for

return(new window.DOMParser).parseFromString(a,"text/xml");

The unshrinked javascript-code for GPX tracks can be found here: https://www.mapsmarker.com/dev/gpx-uncompressed.js

If you display the posts separately, all maps work. Just dont get it - any help is appreciated!
thx!

Answers (1)

2014-03-25

John Cotton answers:

The XML that's being parsed doesn't validate. That might well be your problem.

Interestingly, Chrome is happy to parse it, whereas IE11 isn't.


John Cotton comments:

Here's the XML:

<!DOCTYPE html>\n<!--[if IE 7]>\n<html class=\"ie ie7\" lang=\"en-EN\">\n<![endif]-->\n<!--[if IE 8]>\n<html class=\"ie ie8\" lang=\"en-EN\">\n<![endif]-->\n<!--[if !(IE 7) | !(IE 8) ]><!-->\n<html lang=\"en-EN\">\n<!--<![endif]-->\n<head>\n<meta charset=\"UTF-8\" />\n<meta name=\"viewport\" content=\"width=device-width\" />\n<title>Page not found | dev site for pro version</title>\n<link rel=\"profile\" href=\"http://gmpg.org/xfn/11\" />\n<link rel=\"pingback\" href=\"https://www.mapsmarker.com/dev/pro/xmlrpc.php\" />\n<!--[if lt IE 9]>\n<script src=\"https://www.mapsmarker.com/dev/pro/wp-content/themes/twentytwelve/js/html5.js\" type=\"text/javascript\"></script>\n<![endif]-->\n<meta name='robots' content='noindex,follow' />\n<link rel=\"alternate\" type=\"application/rss+xml\" title=\"dev site for pro version &raquo; Feed\" href=\"https://www.mapsmarker.com/dev/pro/feed/\" />\n<link rel=\"alternate\" type=\"application/rss+xml\" title=\"dev site for pro version &raquo; Comments Feed\" href=\"https://www.mapsmarker.com/dev/pro/comments/feed/\" />\n<link rel='stylesheet' id='twentytwelve-fonts-css' href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700&subset=latin,latin-ext' type='text/css' media='all' />\n<link rel='stylesheet' id='twentytwelve-style-css' href='https://www.mapsmarker.com/dev/pro/wp-content/themes/twentytwelve/style.css?ver=3.8.1' type='text/css' media='all' />\n<!--[if lt IE 9]>\n<link rel='stylesheet' id='twentytwelve-ie-css' href='https://www.mapsmarker.com/dev/pro/wp-content/themes/twentytwelve/css/ie.css?ver=20121010' type='text/css' media='all' />\n<![endif]-->\n<link rel=\"EditURI\" type=\"application/rsd+xml\" title=\"RSD\" href=\"https://www.mapsmarker.com/dev/pro/xmlrpc.php?rsd\" />\n<link rel=\"wlwmanifest\" type=\"application/wlwmanifest+xml\" href=\"https://www.mapsmarker.com/dev/pro/wp-includes/wlwmanifest.xml\" /> \n<meta name=\"generator\" content=\"WordPress 3.8.1\" />\n\n<!-- Bad Behavior 2.2.15 run time: 2.316 ms -->\n<script type=\"text/javascript\">\n<!--\nfunction bb2_addLoadEvent(func) {\n\tvar oldonload = window.onload;\n\tif (typeof window.onload != 'function') {\n\t\twindow.onload = func;\n\t} else {\n\t\twindow.onload = function() {\n\t\t\toldonload();\n\t\t\tfunc();\n\t\t}\n\t}\n}\n\nbb2_addLoadEvent(function() {\n\tfor ( i=0; i < document.forms.length; i++ ) {\n\t\tif (document.forms[i].method == 'post') {\n\t\t\tvar myElement = document.createElement('input');\n\t\t\tmyElement.setAttribute('type', 'hidden');\n\t\t\tmyElement.name = 'bb2_screener_';\n\t\t\tmyElement.value = '1395749308 2a01:4f8:101:2002::3';\n\t\t\tdocument.forms[i].appendChild(myElement);\n\t\t}\n\t}\n});\n// --></script>\n\t\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"dev site for pro version GeoRSS-Feed\" href=\"https://www.mapsmarker.com/dev/pro/wp-content/plugins/leaflet-maps-marker-pro/leaflet-georss.php?layer=all\" />\n\n<!--Plugin Memory Load and db size Usage 2012.1125.0000 Active - 64Bit Security Tag Key: zGrHCPKv24558pqP7gQXhiS323xjMjN34gSThZFcwsZ8M1HK7iML9TBq5PJgfOsTl-->\n\n</head>\n\n<body class=\"error404 custom-font-enabled single-author\">\n<div id=\"page\" class=\"hfeed site\">\n\t<header id=\"masthead\" class=\"site-header\" role=\"banner\">\n\t\t<hgroup>\n\t\t\t<h1 class=\"site-title\"><a href=\"https://www.mapsmarker.com/dev/pro/\" title=\"dev site for pro version\" rel=\"home\">dev site for pro version</a></h1>\n\t\t\t<h2 class=\"site-description\">mapsmarker.com</h2>\n\t\t</hgroup>\n\n\t\t<nav id=\"site-navigation\" class=\"main-navigation\" role=\"navigation\">\n\t\t\t<h3 class=\"menu-toggle\">Menu</h3>\n\t\t\t<a class=\"assistive-text\" href=\"#content\" title=\"Skip to content\">Skip to content</a>\n\t\t\t<div class=\"menu-menu-1-container\"><ul id=\"menu-menu-1\" class=\"nav-menu\"><li id=\"menu-item-108\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-108\"><a href=\"http://pro.mapsmarker.com/\">Home</a></li>\n</ul></div>\t\t</nav><!-- #site-navigation -->\n\n\t\t\t</header><!-- #masthead -->\n\n\t<div id=\"main\" class=\"wrapper\">\n\t<div id=\"primary\" class=\"site-content\">\n\t\t<div id=\"content\" role=\"main\">\n\n\t\t\t<article id=\"post-0\" class=\"post error404 no-results not-found\">\n\t\t\t\t<header class=\"entry-header\">\n\t\t\t\t\t<h1 class=\"entry-title\">This is somewhat embarrassing, isn&rsquo;t it?</h1>\n\t\t\t\t</header>\n\n\t\t\t\t<div class=\"entry-content\">\n\t\t\t\t\t<p>It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.</p>\n\t\t\t\t\t<form role=\"search\" method=\"get\" id=\"searchform\" class=\"searchform\" action=\"https://www.mapsmarker.com/dev/pro/\">\n\t\t\t\t<div>\n\t\t\t\t\t<label class=\"screen-reader-text\" for=\"s\">Search for:</label>\n\t\t\t\t\t<input type=\"text\" value=\"\" name=\"s\" id=\"s\" />\n\t\t\t\t\t<input type=\"submit\" id=\"searchsubmit\" value=\"Search\" />\n\t\t\t\t</div>\n\t\t\t</form>\t\t\t\t</div><!-- .entry-content -->\n\t\t\t</article><!-- #post-0 -->\n\n\t\t</div><!-- #content -->\n\t</div><!-- #primary -->\n\n\t</div><!-- #main .wrapper -->\n\t<footer id=\"colophon\" role=\"contentinfo\">\n\t\t<div class=\"site-info\">\n\t\t\t\t\t\t<a href=\"http://wordpress.org/\" title=\"Semantic Personal Publishing Platform\">Proudly powered by WordPress</a>\n\t\t</div><!-- .site-info -->\n\t</footer><!-- #colophon -->\n</div><!-- #page -->\n\n\n<!--Plugin Memory Load and db size Usage 2012.1125.0000 Active - 64Bit Security Tag Key: zGrHCPKv24558pqP7gQXhiS323xjMjN34gSThZFcwsZ8M1HK7iML9TBq5PJgfOsTl-->\n\n<script type='text/javascript' src='https://www.mapsmarker.com/dev/pro/wp-content/themes/twentytwelve/js/navigation.js?ver=1.0'></script>\n<script type=\"text/javascript\">\n//markermap_338.setZoom(21);\n</script>\n</body>\n</html>

Checked with http://validator.w3.org/check


Robert Seyfriedsberger comments:

you´re right, thanks. Removed the (non existing) gpx url and then it works - seems like I have to add a fallback for IE if gpx cant be parsed (any hints appreciated ;-)


John Cotton comments:

...mind you, I've cleaned up the XML and got it to validate and IE still gives an error!


Robert Seyfriedsberger comments:

FYI: the url to the gpx file does not exist anymore and so the whole website gets loaded instead - this crashes IE maps. I removed the (non-existing) gpx url from map ID 335 and it worked again


Robert Seyfriedsberger comments:

the fallback would need to be added somewhere here I guess:

_parse_xml: function(xmlStr){
if (typeof window.DOMParser != "undefined") {
return ( new window.DOMParser() ).parseFromString(xmlStr, "text/xml");
} else if (typeof window.ActiveXObject != "undefined" && new window.ActiveXObject("Microsoft.XMLDOM")) {
var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(xmlStr);
return xmlDoc;
} else {
throw new Error("No XML parser found");
}
},