Local Weather - How does the website receive the data?

Local Weather - How does the website receive the data?
0.0 0

#1

I’m quite surprised by this example pen http://codepen.io/FreeCodeCamp/full/bELRjV in the Local Weather project. It recognizes my location even though the browser did not ask me if I approve sharing my location data. Not that there any problem, I just want to understand.


#2

You can look at the source code and see that they used http://ipinfo.io/ to get your location by IP.


#3

Yes. In fact I think you have to use IP info to get user location for this project if you are hosting it on CodePen. Geolocation (preferred method of getting a users location) does not work on insecure origins, like CodePen. This was my experience anyway.