Daily Archives: October 30, 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

  1. span class=”co1″>// JS code to create your map

If you are using prototype you can use

  1. span class=”st0″>"dom:loaded"

Or you can add an onload attribute to your body tag

  1.  
  2. "loadMap()"
  3.  

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

  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. "http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"
  5.  
  6. "text/css"
  7. v\:* {
  8. behavior:url(#default#VML);
  9. }
  10.  
  11.  

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.

  1.  
  2. "maps.js""text/javascript""defer"
  3.  

It can be also a problem with a base tag messing wiht IE more info on
http://www.shauninman.com/archive/2007/04/13/operation_aborted