Get Geolocation Data /no geolocation coords

Tell us what’s happening:
The task was passed, but on the vurtual “phone” was no geolocation coords. How to fix it?

Your code so far

<script>
  // Only change code below this line.
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      $("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);
    });
  }
  
  
  // Only change code above this line.
</script>
<div id = "data">
  <h4>You are here:</h4>
  
</div>

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/get-geolocation-data

Do you get a prompt to enable geolocation? Something like this: image

hi, there was no prompt like this.

Maybe geolocation is disabled for your browser. You can try a google search on how to enable geolocation.

thanks for your help, I’ll try.

Checked: fcc site in the list of sites, which can get access to geolocation. But phone still doesn’t show coords.

Which browser are you using? Have you tried other browsers? Sorry I can’t help any further…

I’m using google chrome. Under linux. Thanks for your wish to help, Now I’ll just try by myself)))!