TLDR upfront, I can’t access all of the data in an api call, through my attempt at installing a search bar.
I’ve already completed the challenge, decided to do a redesign. It was going well till I showed my wife.
“Why don’t you put a search bar in there?” she asked.
And a week later, here I am.
The problem I can see, though I’m sure there’s one or two can’t, is that I can’t seem to access all of the children of my data variable.
Here’s the offending piece of code:
$("#search").click(function() {
var searchTerm = $("#searchTerm").val();
var api = "http://api.openweathermap.org/data/2.5/find?q="+searchTerm+"&appid=8e072ad976ee4c5d0d633a49e44598ee";
//STUCK HERE!!!! CAN'T ACCESS CHLIDREN OF .list
$.getJSON(api, function(data) {
//TESTING
console.log("banana");
//WORKS HERE GOOD
console.log(data);
//STILL WORKING HERE
console.log(data.list);
//WHY NOT HERE?
console.log(data.list.clouds);
});
});
The whole project is here: http://codepen.io/SpazCool/pen/XdLmEa?editors=0012
So, guys and gals, any ideas?
Thanks ahead of time.