Weather api not working right

Weather api not working right
0

#1

My weather app is not showing my current weather it stays the same and my icons are not showing up.
Please help?
thanks,
Nadia

https://codepen.io/npardon/pen/YrYMEg


#2

The reason it does not show anything, is because data.weather[0].icon in the render function is undefined, because for the latitude and longitude you were using (in Japan), it did not have such a property. Maybe the fcc api only works for certain countries.

Anyway, if you use the actual latitude and longitude you get back from the freegeoip.net/json api, then everything will work fine once you add some code in your render function which uses the icon variable to display the icon image on your page. I do not see where you are trying to reference the icon after you assign it a value in the render function.