Hey ya’ll, I’m stuck on the weather app project.
I’m able to retrieve the data however, I can’t display the icons.
I’m trying to determine a pathway to retrieve the icons from the fcc weather app api by looking at the OpenWeatherMap api icon info:
I would appreciate any constructive criticism
FYI: So far what I have is the result of youtube tutorials, googling, and the example project itself. Therefore, I claim no ownership to what I have. I can say I understand the aspects to learn for the project, but I’m just stuck on completing it.
#1) First you need to fix the error showing in your console (Ctrl+Shft+I in chrome).
#2) result.weather.icon already has the url to the icon in it. For example, for my weather, it has the value “https://cdn.glitch.com/6e8889e5-7a72-48f0-a061-863548450de5%2F03d.png?1499366020890” So, you do not need to add the “.png” on the end.
#3) Assuming you correct #2 above, your current code of
is not going to display the image. You need to read about the JQuery attr function. You need to target the src attribute with the icon variable. you will need to read down about half way into the documentation for this function where it discusses “Set one or more attributes for the set of matched elements.”
Thank you so much for pointing those errors out! I think I managed to get something running: