I am currently facing an issue while trying to make a JSON request from the open weather API example. When I attempt to access the key value in the $.each method, it keeps showing that the value for the key is undefined. Can someone please review the code and help me identify what I am missing?
function getGs(data) {
$.each(data.main,function(i,weather){
console.log(weather.humidity);
})
}
$(document).ready(function() {
var bggAPI = "http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139?";
$.ajax({
dataType: "json",
url: bggAPI
});
getGs();
});