// Does the browser support geolocation?
// @see http://www.w3schools.com/html/html5_geolocation.asp.
if(navigator.geolocation) {
// When clicked on deny, error function is triggered.
navigator.geolocation.getCurrentPosition(success,error);
} else {
console.log('Browser doesn\'t support geolocation, default geolocation unsupported action.');
}
function success(pos) {
console.log('User allows, location specific action.');
}
function error(error) {
console.log('User denies, default geolocation supported action.');
}