I have 3 querys and I need every time the setInterval triggers it to execute a query at the end, go back to the first one.
setInterval(function () {
var query1 = "select * from weather.forecast where woeid = '429100' and u = 'c'";
var query2 = "select * from weather.forecast where woeid = '455823' and u = 'c'";
var query3 = "select * from weather.forecast where woeid = '456964' and u = 'c'";
var queryURL = "https://query.yahooapis.com/v1/public/yql?q="+query2+"&lang=ptBR&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys/";
$.getJSON(queryURL, function (data) {
var results = data.query.results;
var firstResult = results.channel;
console.log(firstResult);
var location = firstResult.location.city;
var temperaturaHoje = firstResult.item.condition.temp;
var condicaoHoje = firstResult.item.condition.code;
});
},5000);