Google Maps Not Working in Internet Explorer (IE)

Posted May 4, 2006 at 7:55 AM

Tags: Javascript / DHTML, HTML / CSS

I am working on a page where I have a google-powered map (just like the one you find on maps.google.com. It works just fine in FireFox (of course), but in IE, I am getting a very strange error. The page loads fine, but then just when you think you are in the clear, I get an error that says Could Not Open Page "http://....." page aborted. Then, it jumps from the seemingly fine page to the Page Cannot Be Displayed page. It is so frustrating because the page does not seem to be throwing any Javascript errors. Nothing comes up in the FireFox console, and no little alert icon in IE. And, what's more frustrating is that I do NOT get the alert if I take out a FOR loop that has no content. What's up with that?!?

Post Comment  |  Ask Ben  |  Print Page




Learning ColdFusion 9 - ColdFusion 9 tutorials, samples, examples, demos

Reader Comments

Nov 10, 2006 at 5:57 AM // reply »
2 Comments

Did you solve this problem? i am also suffering with this problem and cant get the cause of this problem?

Please let me know the best solution..

Regards

F


Nov 10, 2006 at 6:03 AM // reply »
2 Comments

Did you solve this problem? i am also suffering with this problem and cant get the cause of this problem?

Please let me know the best solution..

Regards

F


Nov 10, 2006 at 7:22 AM // reply »
7,572 Comments

Fahad,

I have not solved it yet. I sort of gave up and moved on. The map wasn't anything all that important. I hope to come back to it soon though when I get some free time.


Nov 29, 2006 at 11:54 AM // reply »
1 Comments

Hi

Just worked this one out. IE sometimes has a problem if the map starts loading before the page itself has finished loading. Basically you need to wait until the onload event fires from the page and then build your map.

Put the map initialisation code into a function "myloadmap" and then

<body onload="myloadmap()">

Regards

Toby


Nov 29, 2006 at 11:58 AM // reply »
7,572 Comments

Toby, thanks I will check out that solution. It sounds good to me. I sort of gave up on this, but you might have just rekindled the fire :D


Mar 26, 2007 at 6:45 PM // reply »
2 Comments

I think Toby has the solution. The working example that Google has on their API page has the onLoad in the body tag to do your map dirty work... I wish this weren't the case, as I don't want to have to put the code in there. Does anyone know how to reference the body.onLoad action through another means, say in an on page call? If so, email me. [[[hello ]]at] wes ][ alvaro [dot[[ com]]]


May 7, 2007 at 10:21 PM // reply »
2 Comments

I solved it by using GMapEZ:
http://bluweb.com/us/chouser/gmapez/


Jun 28, 2007 at 11:31 PM // reply »
1 Comments

You might be able to use the following to replace your body onload. I did it once, and it worked mostly.
<script type="text/javascript">
window.onload = load();</script>


Jul 1, 2007 at 9:45 PM // reply »
7,572 Comments

Thanks, I will try that. I have not worked on this in a while, but I think you are correct in your suggestion. Thanks.


Jan 22, 2008 at 9:44 AM // reply »
1 Comments

This solution will work for ALL browsers and requires very little effort. I modeled it after this website...
http://simonwillison.net/2004/May/26/addLoadEvent/

Put this entire script inside of your <head> tags.

The reason why this works is it loads the google map information last (even after the body onload event). This works for all browsers. To view a working example of this visit www.sitelinksearch.com and click on a state.

<script type="text/javascript">
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}

//Setup the map
addLoadEvent(function() {
load();
showAddress("raleigh, nc");
})
</script>


Mar 30, 2008 at 4:48 AM // reply »
1 Comments

Thank Lucas.

That worked perfect.


Nov 6, 2008 at 3:26 PM // reply »
1 Comments

I'm having this problem too, it's much faster/easier for me to switch my clients who know nothing about the internet over to firefox. I'm suprised that google hasn't sorted this issue out.

I'm running Vista with IE7 with this error.


Mar 3, 2009 at 2:05 PM // reply »
1 Comments

I tried this solution from Lucas, and I couldn't get to work...
If any of you could see this page http://www.seniorfocusonline.com/Assisted_Living_Apartments/CHANDLER.CTY in Firefox and in Internet Explorer - and maybe let me know if I am missing something.
I would appreciate it.
Thank You


Mar 4, 2009 at 8:11 AM // reply »
7,572 Comments

@Renato,

You might try adding a slight delay to your ShowAddress() call. Something like:

setTimeout(
function(){
showAddress( ... );
},
500
);

I know it is already waiting for the page to load, but just try it anyway :) I am not sure what it would be fixing, but I have fixed some stuff by adding a slight delay.


May 13, 2009 at 8:45 AM // reply »
1 Comments

Ben!

When everything else fails try putting your init() function in a script block outside the <body>.
It's not pretty but it worked for me when all the other options didn't worked.

Greetz,

Jaime


Jun 10, 2009 at 11:30 AM // reply »
1 Comments

great , it works!


Jun 22, 2009 at 1:55 AM // reply »
1 Comments

Here the google map is seen in Mozilla and Google chrome but it is not displayed in internet Explorer


stm
Jun 29, 2009 at 10:04 AM // reply »
1 Comments

I have a problem that when my website in viewed in internet explorer only part of the map shows up until i resize the browser screen then it snaps into place.
It works fine in firefox.
Any thoughts on what might be wrong?


Jul 13, 2009 at 4:07 PM // reply »
6 Comments

This page will help to solve most issues with Internet Explorer

http://www.easypagez.com/maps/ieworking.html

Ralph


Jul 14, 2009 at 4:54 AM // reply »
1 Comments

Also don't forget to validate your HTML. This keeps and gets your Google Maps up and running.


Aug 7, 2009 at 5:09 PM // reply »
1 Comments

@Lucas,

Hi Lucas, Thanks, you are a real star.
That little code sorted a problem I have been chasing round in circles with for weeks.

Thanks

Adrian


Sep 7, 2009 at 5:02 AM // reply »
1 Comments

Hi,
I am new to google maps. I build a site which is running fine in FF and google Chrome, but its not working in IE. Please see to the link and solve my problem. (http://deal.fullserviceplatform.com)

Its very urgent.
Thanks in advance


Dan
Nov 11, 2009 at 4:05 PM // reply »
1 Comments

@Lucas

Nice work mate. Worked a charm.


Dec 22, 2009 at 3:36 PM // reply »
3 Comments

Hi,

I'm having an issue where IE isn't loading markers. It seems to be having a problem with the point var below. When it gets to displayTabbedMarker, IE says that it's looking for an object. Firefox, Chrome etc... all work fine and display the markers. IE says the error occurs at line 40, char 21 in my page, this is the section where I'm extracting the information from the XML file.

I've tried adding timeouts and tried the addLoadEvent function as well, but no joy. I'm pretty sure it's my code but am failing to see the wood for the trees at the moment.

http://girlgeekdinners.webs.com/Native%20Parks/Motorhome_Havens_(2008_-_2009)2.html

Hope someone can help.

Cheers,
Amanda


Dec 22, 2009 at 5:16 PM // reply »
6 Comments

@Amanda Jackson

The problem is more than likely because there is no data in the address1 tag.

Ralph


Dec 22, 2009 at 5:32 PM // reply »
3 Comments

Thanks Ralph,

I'll look at the XML again when I get home tonight and let you know if it fixes the issue. The XML was the first thing I checked as I know that there are problems when data is missing in tags, but I must've missed one.

Cheers,

Amanda


Dec 22, 2009 at 6:14 PM // reply »
3 Comments

The tag was indeed the problem. Thought I'd resolved it by putting in the space which Chrome and Firefox handled just fine, IE needs an actual character as a placeholder, which is unfortunate as now the tab will have a point showing, but at least the markers are showing up now. :)

To do list when I get home tonight... stick in some code to handle blank tags should they occur in the future. :)

Thanks for your help.

Cheers,

Amanda


Dec 28, 2009 at 10:40 AM // reply »
1 Comments

My personal problem for the map not working was that I had another div named "map" which does not work because the google map api div is named "map". I had to rename the other div.


Dec 28, 2009 at 10:24 PM // reply »
7,572 Comments

@Ralph,

Thanks for dropping in and helping @Amanda out; rock on :)

@Steven,

Yeah, that will get you every time; what makes that more frustrating is that I think that doesn't actually break in *every* browser (even though it probably should).


Jan 4, 2010 at 11:59 AM // reply »
3 Comments

I have tried out all the solutions which where posted on top but still i am not able to run the web page with IE.

any solution! it's urgent


Jan 4, 2010 at 12:32 PM // reply »
6 Comments

@dinesh

Can you post a link to your map that doesn't work in IE.

Ralph


Jan 4, 2010 at 3:47 PM // reply »
3 Comments

this is the link


Jan 4, 2010 at 3:55 PM // reply »
3 Comments

http://www.vet.ksu.edu/mentorships/Applications/International/MapSearch.htm


Jan 4, 2010 at 5:44 PM // reply »
6 Comments

@dinesh

IE might be having a problem with using percentages for the width and height of the map.

Ralph


Mar 12, 2010 at 9:19 AM // reply »
2 Comments

I'm working on a project and am having a similar problem. The page "loads fine" in IE6/7 so long as I don't expect markers to load. Using jquery1.4, easing plugin, maps api 2, extinfowindow, and markerclusterer. Runs beautifully in almost everything except the infowindow is garbled in Opera and markers won't load in IE6/7. Also, to get the map to show in IE6/7 at all, I have to remove the "is gbrowser compatible" if/else statement.


Mar 12, 2010 at 9:35 AM // reply »
6 Comments

@James

Can you provide a link to your map please.

Ralph


Mar 15, 2010 at 12:49 PM // reply »
2 Comments

@Ralph, thanks in advance for the look at:

http://76.12.123.25/asia/map/


Mar 17, 2010 at 11:22 PM // reply »
6 Comments

@James

The page has a problem in IE7, because line 112 has a comma at the end.

Line 112 is the first problem, there are many more with the same.

Ralph


Post Comment  |  Ask Ben

Recent Blog Comments
Mar 21, 2010 at 8:57 PM
The Bourne Ultimatum Starring Matt Damon And Julia Stiles
late to the party, but my observation is this: rewatch carefully for the platonic nature of the relationship between nicki and jason. she never flirts with him. he never comes on to her. they alway ... read »
Mar 21, 2010 at 7:40 PM
Is Simulating User-Input Events With jQuery Ever A Good Idea?
A couple of things. One you embed the initial state of of more-info in the CSS. IMHO, that behavior should be in jQuery: moreInfo.hide(); It shows that the behavior your toggling and closing is mor ... read »
Mar 21, 2010 at 3:59 PM
Exploring ColdFusion Component Runtime Class Properties And Serialization
@Elliott, according to Ben's experiment, serializeJSON() doesn't access the private data by default - it doesn't even access the getHair() method - so trying to clone a Girl.cfc via serializeJSON/des ... read »
Mar 21, 2010 at 3:49 PM
Ask Ben: Javascript String Replace Method
I'm confused a bit by what you are asking, but if had this sentence: The color, red, is in the style statement; style: red;. and wanted to remove all or change all of the commas, colons, and semi-c ... read »
Mar 21, 2010 at 3:13 PM
Ask Ben: Javascript String Replace Method
I am trying to make a java program to count the number of times that these punctuation marks occur in a body of text: , : ; . ! - ' " ? / \ I am using this piece to ferret out the commas: numcommas ... read »
Mar 21, 2010 at 11:13 AM
A New Wrist Pain
@chiropractor suwanee, Spoken like someone trying to sell something. Other than for minor, temporary relief from some back pain, chiropractic treatment is nothing but placebo effect and quackery. ... read »
Mar 21, 2010 at 6:32 AM
ColdFusion CFPOP - My First Look
Apologies... The field name in the db for C. is "BounceCode" It stores the code / message which is returned in the email. Sorry for the confusion. ... read »
Mar 21, 2010 at 6:29 AM
ColdFusion CFPOP - My First Look
@Jose Galdamez, Hi Ben and Jose 1st of all.. big thanks to Jose for his Skype chat a few weeks back. Your time was much appreciated. I have come up with a rather unelegant solution to my problem a ... read »