Weather App Geolocation Problems

Weather App Geolocation Problems
0

#1

Since the way of obtaining geolocation shown in the course won’t work in Chrome anymore, I tried a couple of other APIs and none of them work. But none of them work and when I check in the debugger the callback is always skipped over.

This is the example of the GET method I use:

$.getJSON("http://ip-api.com/json&callback=?", function(data){

I used these APIs:

freegeoip.net/json/

http://ip-api.com/json

Please help!!


#2

Could you please post your work on CodePen, or at least a repository?

This is a very common misconception that has been making this project more difficult for students than it should be. Browser geolocation works perfectly well, but you need to make sure your app is hosted securely (https://...), and that all AJAX calls are also made to secure servers. This is very easy to do, much easier than using these janky IP address hacks. When you’ve posted your code, we’ll get you sorted out.