Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How do I fix google map 'undefined' is null or not an object in IE 8?

Posted on 2011-09-17
3
2,355 Views
Last Modified: 2012-05-12
I have a website where I have implemented Google map with zip code search. It is here, http://optionsunited.com/index.php/your-options/abortion-answers.html

I have used custom Google Map code. When we view in IE 8, there is an error

How can I fix this or at least avoid /ignore from the browser..?

I tried already to find some solution in other places but that did not help.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; chromeframe/13.0.782.220; chromeframe; .NET CLR 2.0.50727; InfoPath.2)
Timestamp: Sat, 17 Sep 2011 06:52:00 UTC


Message: 'undefined' is null or not an object
Line: 36
Char: 119
Code: 0
URI: http://maps.gstatic.com/intl/en_us/mapfiles/api-3/6/4/main.js

Open in new window

0
Comment
Question by:Loganathan Natarajan
  • 2
3 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36553854
try after removing the base tag
0
 
LVL 29

Accepted Solution

by:
fibo earned 500 total points
ID: 36553874
It seems from here http://www.delphifaq.com/faq/javascript/extjs/f3476.shtml that you have 2 possible causes to your problem:
- javascript is passed on some data array with an external comma, which makes IE <9 to complain (your page diisplays no error in IE9).. the trick being that IE error message does not locate exactly where is the problem (but it seems that if people look for a city, your Gmap query is "city,", not sure if that is the comma!)
- you are passing some undefined data and IE complains. using debugging mode of IE9, this problem seems to come from a js variable 'position' OR from an HTML id 'position' that your javascript does not find

Looking at your page in FF (6) + the webdevelopper extension, I get the following error messages:

Erreur : unterminated string literal
Fichier Source : http://optionsunited.com/index.php/helpful-links/clinics-in-los-angeles.html?view=googlemap&amp;re=maplist&amp;lat=47.6739881&lon=-122.121512&id=redmond#smap
Ligne : 280, Colonne : 21
Code Source :
         showAddress("44733 10th Street West 

Erreur : initialize is not defined
Fichier Source : http://optionsunited.com/index.php/helpful-links/clinics-in-los-angeles.html?view=googlemap&amp;re=maplist&amp;lat=47.6739881&lon=-122.121512&id=redmond#smap
Ligne : 364

Erreur : doc.location is null
Fichier Source : chrome://searchshield/content/overlay.js
Ligne : 705

Open in new window


There are some (lower severity) warnings, but they seem to be related to Google js and you can probably ignore them. One example:
Avertissement : variable a redeclares argument
Fichier Source : http://maps.gstatic.com/intl/en_ALL/mapfiles/367a/maps2.api/main.js
Ligne : 896, Colonne : 57
Code Source :
function zi(a,b,c){var d=new r(a.x+b.width,a.y+b.height),a=Eb(d.x/c-qb),d=Eb(d.y/c-qb);return new Ai(new r(a,d),new r(a*c-b.width,d*c-b.height))} 

Open in new window

ADDITIONAL NOTE:
You are using a deprecated (V2) option of Google API. See page http://code.google.com/apis/maps/signup.html and others.
While I suggest you keep it until you problem is solved, you MUST add the 'sensor=' parameter, in your case that would be 'sensor=false'. See http://code.google.com/apis/maps/documentation/javascript/v2/basics.html#SpecifyingSensor
This last point might (not sure!) be related to the 'position' problem
0
 
LVL 29

Expert Comment

by:fibo
ID: 36573529
B-) Glad I could help. Thx for the grade and points!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to count occurrences of each item in an array.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question