Hello campers,
I am trying to use this piece of code given to use by FCC in a challenge called ‘Get Geolocation Data’
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$("#data").html("latitude: " + position.coords.latitude + "
longitude: " + position.coords.longitude);
});
}
For some reason this does’t work within my pen. Could anyone take a look for me?
Thanks