Microsoft Internet Explorer Sucks

| | Comments (12) | TrackBacks (0)

Most of my readers will probably consider the above to be self evident, but I'm mostly ranting about a specific bug I've encountered with the Google Maps API map I've put together for my church web site, newhopeks.org.

Try viewing that page in MSIE (5.5+ please, since that's what Google supports) and see what you get. (Well, it might be fixed by the time you read this, but if not...) If you're lucky, it'll just work. If you're not lucky, you got a box saying:

Internet Explorer cannot open the Internet site http://www.newhopeks.org/map

Operation aborted.

If you're especially unlucky, when you clicked OK, it took you to a page saying "The page cannot be displayed." (This error comes up even though you could see the map and everything up until you clicked OK.)

So, what's the problem? It turns out that if you have some JavaScript (the language Google Maps is written in) and you use a technology called DOM to manipulate the page (which Google Maps does) and you put the script in a <script/> tag inside of a <div/> tag or a table, MSIE freaks out some large percentage of time. I haven't even gotten the error consistently even on the same machine. This is complete idiocy. There's no way an error like this should have made it into production software and if it did, it should have been found and patched ages ago. This is what regression testing is for. Especially since this is a very well known error (just google for ""Internet Explorer cannot open the Internet site" "Operation aborted"" if you don't believe me).

The moral of the story is, don't use Internet Explorer. I recommend Firefox or Apple Safari or Opera or any of the Mozilla-based alternatives (except for Netscape as AO-Hell has ruined it).

Oh, well. Being the web developer who has to make his stuff work everywhere, I now I have to figure out how to move my script out of all the <div/> tags that make up the New Hope theme...

0 TrackBacks

Listed below are links to blogs that reference this entry: Microsoft Internet Explorer Sucks.

TrackBack URL for this entry: http://contentment.org/mt/mt-tb.cgi/482

12 Comments

"IE cannot open... Operation aborted" with Google Maps
I have the EXACT same issue, google map and all, and google'g for EXACTLY what you said to is how I found you.

I went to your site and map and it does EXACTLY the same as mine... in M$IE only... so, per your suggestion/comment, I removed the <div> tag that surrounded (and CENTERED) the map and the rest of the page. Well, it's ugly, but at least now it works on the most non-compliant and most incredibly popular browser on the planet.

Actually, I've done one step better now... I have my map on a php page, so I ripped the guts out (everything between the <div align="center"> and </div> tags) and put that in a php include member. Then I put in a browser detect script in the original (centered) page to redirect poor IE users to a dumbed-down uncentered page, which I created exactly like the first, except no <div align="center>. That way I can just provide one URL and IE suckers get their due, and I get mine!

Solution ...
I just ran across this problem as well, the solution I utilized was to put the map itself into a new webpage then use an inline frame within the page I intended it to be.

That works too
I believe the correct response is, "Oooooogly." :) Since I'm primarily interested in a solution the works within Drupal and because I need some fancy features added on, I'm writing a map module. My solution works quite well and could work as a node too.

Basically, (and also ooooogly) I do need to place the script-tag even after the footer, so the only way I know how is to theme the whole page, and then I do a regex replace to replace </body> with <script...>...</script></body>. That did the trick. :)

Solution from Google Examples
I am another one that had this problem with Google Maps and Internet Explorer. I found a solution by checking the examples from the Google Maps API Documentation page in Internet Explorer itself.

Looking at the source code when displaying an example in Internet Explorer, you can see that the code that generates the page is different that the code that is listed in the documentation page.

In order to get Internet Explorer to display the map, the script is in between the <head> tags. Also, the Internet Explorer specific <html> tags needs to be used along with the <style> tag that enables VML.


Implementing these things in my page allowed the google map to be displayed in Internet Explorer and Firefox with a single HTML file.

I have not tested to see if it still works in Safari and Opera yet.


Cheers!

Did you figure it out?
To allow the Google Map API in IE, just turn insert this into your body tag:

onload="mapload();"

then wrap your existing gmap code with:

function mapload() {

}

That should do the trick.

That's awesome. Worked miracl
That's awesome. Worked miracles for me. THANKS!

Thank you!
Worked for me too.. was about ready to dig my brain out with a spork! ( you know one of those half spoon half fork thingys)

Thanks again.

if only I could change the world....
I use Firefox and Opera as much as possible on my Windoze machine and Firefox, Opera and Safari on my Mac.

The problem is all my internal users and of course the majority of the public still use IE.

Back to Google maps... I was having this same error loading a map in IE, no problems in the other browsers. I kept trying to find a JS error but couldn't.

I resorted to removing a few lines of code at a time and reloading just to troubleshoot. Believe it or not, when I removed a CENTER tag from my HTML the problem disappeared.
...at least for now. You've got me paranoid now that it's an intermittent problem that will show up again.

In may case, works well with
In may case, works well with this suggestion (Thanks!):

<body onload="mapload();">
<div id="container">
<div id="map" style="width: 500px; height: 400px"></div>
<script src="http://maps.google.com/maps?file=api&v=1&key=ABQ[etc]" type="text/javascript"></script>
<script type="text/javascript">
function mapload() {
[etc]
}
</script>
</div>
</body>

Works in IE and Firefox (so it seems...) Thanks a lot!!

Sweet
Thanks, this worked for me. IE sucks.

Thanks!
That worked great, thanks a lot. I can't tell you how much time I wasted screwing around trying to make this work in IE.

Remove the script from inside any divs
I had this same problem with my wordpress blog. I found a simple solution. In google's example page -- the script that they put just below the div id = map, is inside of the pages <body>. Just simply move it outside the <body> of your page, so that it is not inside of any divs.

Leave a comment

About this Entry

This page contains a single entry by Andrew Sterling Hanenkamp published on August 11, 2005 7:25 AM.

Google Map Hacking was the previous entry in this blog.

CNS Mail Migration Complete is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.