This is my codepen. I just put the api url into the JSON stringify, but there’s still no output. How do I get it to work?
appID variable is a string and not a number, so you should use quotes
$.getJSON() function’s first argument should be a URL starting with the protocol (https://)
You have a couple of issues to deal with here. First, the structure of your getJson request needs some attention. Look at the example on this page: http://www.w3schools.com/jquery/ajax_getjson.asp. Be sure your URL is a real URL (for example, https://whatever.com/etc)
The second big issue you need to correct is that once you make the correct call and data come back (after you fix the JSON call) you have no place for the data to show up.
I assume you want it to appear below your button. You must explicitly indicate where you want the data to go. I bet if you review your random quote generator project, it will be obvious to you. If no, give another shout. I know I struggled with that concept for quite a while, but once you get it, you will never forget it.
Best of luck,
He does have a
div with a
message class, that won’t be a problem. Did I miss something?
Your third problem is with your link to openweather data, it should be: http://api.openweathermap.org/data/2.5/forecast?id=&appid= whereas you have api.openweathermap.org/data/2.5/forecast/city?id=&APPID=
Thanks, for the comments, I’m receiving the data now.
Let me try to clarify… There needs to be a pair of tags such as