Show Local Weather - location/city not showing

Trying to pull data from the online API, the url tests fine, but the data is not showing. I have compared my codes with several similar projects, still couldn’t figure it out.

Here is my pen

Have been stuck for a few days. I just don’t get it… Any help would be appreciated, thanks!

If you look at your browser’s console (Ctrl+Shft+J in Chrome) when you click the button, you will see the error message “Uncaught ReferenceError: $ is not defined” as it applies to the following line of code:


Do you understand what the $ represents in your code?

Also, urls passed to getJSON should be have https:// in front of them to work with Codepen and most browsers.

$ means jQuery?

I have added “https://” in front of the url.

Yes, so you need to add jQuery to your project, so it will work.

1 Like

Thank you! I have added that in the pen settings. Thought it was all included…

It’s finally showing now. Thanks a lot!