This question answers the same question: Sending geolocation when accepting request
I copied part of the code below, but check the page, as there is an example of how to process them, not accept or reject, but ignore the timeout request.
// navigator.geolocation.getCurrentPosition(successCallback, errorCallback, options); navigator.geolocation.getCurrentPosition( function(position){ //do something with position; }, function(error){ // error passed to function //handle condition where position is not available //more specifically you can check the error code... //error.code == 1 if(error.PERMISSION_DENIED){ alert("you denied me! "); } });
source share