In IE7 and IE8 the store locator has two JS errors:

Object doesn't support this property or method
google_store_locator.js
Line 113
Char: 15

'google.gears.factory' is null or not an object
google_store_locator_loc_aware.js
LIne: 64
Char: 5

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sol Roth’s picture

I'm getting these same errors but on different lines using the dev version

line 172
Object dosn't support this property or method

Line 64
google.gears.factor is null or not an object

michfuer’s picture

Status: Active » Closed (won't fix)

Object doesn't support this property or method
google_store_locator.js
Line 113
Char: 15

Apparently IE doesn't support the .trim() method until IE9 http://stackoverflow.com/questions/9091113/trim-is-not-working-in-ie7

'google.gears.factory' is null or not an object
google_store_locator_loc_aware.js
LIne: 64
Char: 5

The location awareness feature provides two methods by which it attempts to retrieve a user's location: the Google Gears web browser extension, or the Google ClientLocation API. Both of these have lost support (Gears: http://gearsblog.blogspot.com/2011/03/stopping-gears.html, ClientLocation: http://code.google.com/p/google-ajax-apis/issues/detail?id=586#c6)

I think we'll overhaul this feature to use the HTML5 Geolocation API.

dovik’s picture

Status: Closed (won't fix) » Needs review
FileSize
609 bytes

zachorigitano > You can solve this problem by replacing:

var label = list[j].trim();

with:

var label = $.trim(list[j]);

(Line 113 or Line 114 from sites/all/modules/google_store_locator/js/google_store_locator.js)

As "Internet Explorer 8 standards" do not support the trim method.

source

dovik’s picture

solomonrothman > You can solve this problem by adding:

  if (typeof Object.create !== 'function') {
    Object.create = function (o) {
        function F() { }
        F.prototype = o;
        return new F();
    };
  }

Just before:

Drupal.GSL.Panel.prototype = Object.create(storeLocator.Panel.prototype);

(Line 172 from sites/all/modules/google_store_locator/js/google_store_locator.js)

As "Internet Explorer 8 standards" do not support the Object.create function.

source

Horroshow’s picture

Both patched worked here. Thanks!

DrCord’s picture

#4 worked great, the main store locator works now
#3 did not work and I still get the same error and the geolocation fails.

DrCord’s picture

I was able to fix the 'navigator.geolocation' is null or not an object error (which I wasn't able to fix with the patch in #3 by wrapping the call to the geolocation in a check to make sure the object exists

(Line 4 from sites/all/modules/google_store_locator/js/google_store_locator_loc_aware.js)

replace:

navigator.geolocation.getCurrentPosition(positionSuccess, positionError);

with:

if (window.navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(positionSuccess, positionError);
    }
rodrigoeg’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

As IE8 and IE7 are not anymore supported by Microsoft, I think it does not make more sense to correct those javascript errors.