MDN, the local operation does not print the geographical location, nor does it report an error. Why? Ask for instructions
at the beginning, the PC side has been returning a timeout. It may be because the PC side does not support it. After opening it with your mobile phone, you will be prompted: error.code 1 PERMISSION_DENIED
Mobile phone Google browser error: err.code 1, does not allow access to geographical location, how to solve?
where can I reopen the allow or how does js modify whether it is allowed?
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
function success(pos) {
var crd = pos.coords;
console.log("Your current position is:");
console.log("Latitude : " + crd.latitude);
console.log("Longitude: " + crd.longitude);
console.log("More or less " + crd.accuracy + " meters.");
};
function error(err) {
console.warn("ERROR(" + err.code + "): " + err.message);
};
navigator.geolocation.getCurrentPosition(success, error, options);