Monthly Archives: October 2008

Google Maps Operation aborted on IE

If you are getting an annoying message like this

“Internet Explorer cannot open the Internet site”
“Operation aborted”

When trying to see a web page that contains a google map.
And right after the message pop ups Internet Explorer shows an empty page here are some tips to help you fixing this issue

First thing you’ll have to do. Is to move all the code used to generate the map to a function and call it once the page is loaded

  2. function loadMap() {
  3.         // JS code to create your map
  4. }
  5. window.onload=function() {
  6.         loadMap();
  7. }

If you are using prototype you can use

  2. document.observe("dom:loaded", loadMap );
  4. OR
  6. Event.observe(window, ‘load’, loadMap, false);

Or you can add an onload attribute to your body tag

  2. <body onload="loadMap()">

If you are using polylines you should add vml namespace to your header and should look like this

  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3.    "">
  4. <html xmlns="" xmlns:v="urn:schemas-microsoft-com:vml">
  5. <style type="text/css">
  6. v\:* {
  7. behavior:url(#default#VML);
  8. }
  9. </style>

Loading the javascript needed to generate the map as an external file , and adding defer attribute so internet explorer will wait until it loads the page before executing the Javascript. It has the same effect than moving your JS code to the bottom of the page.

  2. <script src="maps.js" type="text/javascript"  defer="defer"></script>

It can be also a problem with a base tag messing wiht IE more info on