Starting simple, just used the same code as in the exercise to pull geolocation data from the browser, but it isn’t working? Any idea why?
Look in your console. Codepen is loaded in http. geolocation in chrome and other browsers requires https. Try using some other way such as an ip api to get information about the user’s location.
btw, this project gives grief to everyone who does it. At the next curriculum update it will no longer be required. I suggest just skipping it right now.
2 Likes
Hi,
Switch your codepen link to https and it will work.
https://codepen.io/earata15/pen/BQKbqb
You will also have to use an API that supports HTTPS to use geo location across all browsers.
Cheers
Mark
We need a sticky for this!
1 Like