HTML5 Geolocation Permission Problem
I am using Google Chrome extension of geolocation. It seems like even if I deny the permission, it still gives the location. I have even tried changing the location preferences by going to tools and setting them to Not allow to detect the location; bu开发者_开发问答t even then it still works.
How can this be answered ?
The following piece of code should give you a position on e where the alert('Position');
is and in your case when you deny permission should pop up the alert with alert('This should pop up');
navigator.geolocation.getCurrentPosition (
function (e) {
alert('Position');
}, function (e) {
alert('This should pop up');
}
);
精彩评论