I want build a function that gets the forecast weather descriptions of four cities using the Open Weather Map API. The cities are placed in a list in a variable called "cities". I think I must create a for loop to run all cities through the API?
The result should be a list where all cities show 8 weather descriptions of the next 8 days.
This is what I have so far. Any suggestions?
function getDescriptions(){
var cities = [Cannes, London, Amsterdam, Berlin];
$.ajax({
url: 'http://api.openweathermap.org/data/2.5/forecast/daily?q=' + city + "&units=metric" + "&cnt=8" + "&APPID=***",
type: "GET",
dataType: "jsonp",
success: function(data){
var descriptions = data.list[i].weather[0].description;
}
});
}