Solved

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

Posted on 2011-09-17
3
2,342 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

778 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