Google Maps Not Working in Internet Explorer (IE)
Posted May 4, 2006 at 7:55 AM
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
Reader 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
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
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.
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
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
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]]]
I solved it by using GMapEZ:
http://bluweb.com/us/chouser/gmapez/
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>
Thanks, I will try that. I have not worked on this in a while, but I think you are correct in your suggestion. Thanks.
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>
Thank Lucas.
That worked perfect.
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.
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
@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.
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
great , it works!
Here the google map is seen in Mozilla and Google chrome but it is not displayed in internet Explorer
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?
This page will help to solve most issues with Internet Explorer
http://www.easypagez.com/maps/ieworking.html
Ralph
Also don't forget to validate your HTML. This keeps and gets your Google Maps up and running.
@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
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
@Lucas
Nice work mate. Worked a charm.
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
@Amanda Jackson
The problem is more than likely because there is no data in the address1 tag.
Ralph
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
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
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.
@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).
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
@dinesh
Can you post a link to your map that doesn't work in IE.
Ralph
this is the link
http://www.vet.ksu.edu/mentorships/Applications/International/MapSearch.htm
@dinesh
IE might be having a problem with using percentages for the width and height of the map.
Ralph
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.
@James
Can you provide a link to your map please.
Ralph
@Ralph, thanks in advance for the look at:
http://76.12.123.25/asia/map/
@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




