Get Geolocation Data /no geolocation coords

Get Geolocation Data /no geolocation coords
0

#1

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:


#2

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


#3

hi, there was no prompt like this.


#4

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


#5

thanks for your help, I’ll try.


#6

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


#7

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


#8

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