/**
* Gets current user location (if user doesn't disable the option)
* @param callback function which returns the positon coordinates
*/
function getLocation(callback) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
callback(position);
});
} else {
alert("Geolocation is not supported by this browser.");
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.