Solved

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

Posted on 2011-09-17
3
2,363 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
[X]
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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

732 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