Hi guys,
Im wondering why the navigator.geolocalisation function didnt provide me the lat and long of my browser.
The code is exacly the same than on FFC lesson, and on the lesson it works, on code pen it didnt.
Anyone could help ?
http://codepen.io/steffanek/pen/amgLag
HTML part :
<div id="data"></div>
JS part :
$(document).ready(function(){
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$("#data").html("latitude: " + position.coords.latitude +
"<br>longitude: " + position.coords.longitude);
});
}
});