Weather Application Issues

Hello everyone! So I’m having some issues with my weather applications, and was wondering if anyone would be willing to help me out. Here is the link to my project: https://codepen.io/Bosa100/pen/QKbWaZ/. I simply cannot get it to work. At first I realized that my key was not working for some reason, so I tried someone else’s, but it still does not work. I realize that for some reason code inside the $.getJSON call back function (sorry if that is not the correct name for what it is) is not working. I tried alerting/changing the text in the element with id “weather,” but it is not working. Any help would be greatly appreciated. Thanks!

Well, first there was a mixed content error - calling codepen on https and the weather site with http. But even with that weather site is refusing the call. Your url string is the same as mine. When I console.log your url, it works fine when I put it into the address bar. That tells me that it’s a problem with the key.

Don’t get frustrated. I beat my head against my desk for two days trying to get mine to work. (And I used to be a programmer, back when dinosaurs roamed the Earth). Just keep at it, this is part of the learning process. See if you can straighten out your key and then check with us if you’re still having problems.

“I realize that for some reason code inside the $.getJSON call back function (sorry if that is not the correct name for what it is) is not working.”

Yes, that is the correct terminology, just that “callback” is usually one word.

Happy hunting.

1 Like

Thank you so much for your help! So I went ahead and found some thing you could add in front of a http:// address to make it compatible with a https:// address, then I noticed that the projects I saw included a &units= thing in their URL. Once I added that to mine it started working! :smiley: Thank you so much!