.getJSON is not working with OpenWeatherAPI on Chrome?


I cannot seem to retrieve callback from the OpenWeather server.

However, the API link works. I could see JSON data when I tried running the url with the latitude, longitude and API key.

Perhaps I made a syntax error for the .getJSON part of my code?

Forked my codepen code here for reference.

I tried to use forecast.io but it seems that there is no way to retrieve the “city” name and it doesn’t have animated icons.

So I’m not on this project yet, but I was able to get the alert dialog by changing your api string to:

var apiCoord = 'https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?lat='+ lat +'&lon='+long + '&appid=c130f198b172e7e12d1aa4d6a4c356e8';

1 Like

Hey thanks ryan!

I found the answer on the forum to explain to myself what you have changed here.