So I have a pretty simple bit of JS using the navigator.geolocation.getCurrentPosition jammy.
$(document).ready(function(){
$(\"#business-locate, #people-l
You don't get an error message because it has no timeout by default (At least i think). I have had the same problem with firefox only for me firefox always gives an timeout. You can set a timeout yourself like this.
My function works great in chrome but i get a timeout everytime in firefox.
navigator.geolocation.getCurrentPosition(
function(position) {
//do succes handling
},
function errorCallback(error) {
//do error handling
},
{
timeout:5000
}
);
I recommend to watch your errors carefully. Be expected for everything. Have a backup plan for everything. I use some default values or values from my database myself in case both google geolocations and navigator geolocations fails.