hello!
I am working on weather app. my current code status is- “https://codepen.io/karanatwal/pen/YxxVbZ”.
I am not getting geolocation. Can anyone help me out with this?
I found two problems:
-
You haven’t imported jQuery.
-
The function you’re trying to call does not exist. Try the following instead:
if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(function(position){ $("#location").html("latitude: "+position.coords.latitude+"<br>longitude: "+position.coords.longitude);
1 Like