Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#4 | google_store_locator-ie8_object_create_function_support-2007002-1.patch | 747 bytes | dovik |
#3 | google_store_locator-ie8_trim_method_support-2007002.patch | 609 bytes | dovik |
Comments
Comment #1
Sol Roth CreditAttribution: Sol Roth commentedI'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
Comment #2
michfuer CreditAttribution: michfuer commentedApparently IE doesn't support the .trim() method until IE9 http://stackoverflow.com/questions/9091113/trim-is-not-working-in-ie7
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.
Comment #3
dovik CreditAttribution: dovik commentedzachorigitano > 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
Comment #4
dovik CreditAttribution: dovik commentedsolomonrothman > You can solve this problem by adding:
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
Comment #5
Horroshow CreditAttribution: Horroshow commentedBoth patched worked here. Thanks!
Comment #6
DrCord CreditAttribution: DrCord commented#4 worked great, the main store locator works now
#3 did not work and I still get the same error and the geolocation fails.
Comment #7
DrCord CreditAttribution: DrCord commentedI 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:
with:
Comment #8
rodrigoeg CreditAttribution: rodrigoeg at CI&T commentedAs IE8 and IE7 are not anymore supported by Microsoft, I think it does not make more sense to correct those javascript errors.