Need help with weather app. Can't get icon url! Why?


I’ve problems figuring out how to output my weather icons from the fcc weather api. It’s bothering me so much and i can’t find answers on the internet. I have added alert(icon) to show whats actually going on but it says ‘undefined’. Or is there any other way to solve it. feel free to fork my pen.

Here’s my project pen:

Also, disregard the layout. I plan to work the css3 last :slight_smile:

Okay, I figured that part out but i’m having trouble with this code.

$('#icon').html("<img src = "icon"></img>");

I checked out your pen. It looks like you figured out how to get the icon value.

yeah, for some reason, i had to restart my computer and it suddenly showed up… Thanks for checking out. :slight_smile:

$('#icon').html("<img src = "icon"></img>");

Why doesn’t this work?

I just checked your Codepen at 11:55 PM PST, and you figured out how to show the icon. Great!