Fix javascript errors emitted in browsers that do not support w3c geolocation

This commit is contained in:
Craig Andrews 2009-11-20 14:46:27 -05:00
parent 09a021cefe
commit b688c572c9
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
// A shim to implement the W3C Geolocation API Specification using Gears or the Ajax API
if ( typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) (function(){
if (typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) (function(){
// -- BEGIN GEARS_INIT
(function() {
@ -94,7 +94,7 @@ var GearsGeoLocation = (function() {
}
};
})();
});
var AjaxGeoLocation = (function() {
// -- PRIVATE
@ -208,9 +208,9 @@ var AjaxGeoLocation = (function() {
}
};
})();
});
// If you have Gears installed use that, else use Ajax ClientLocation
navigator.geolocation = (window.google && google.gears) ? GearsGeoLocation : AjaxGeoLocation;
navigator.geolocation = (window.google && google.gears) ? GearsGeoLocation() : AjaxGeoLocation();
})();