1
I have 3 querys and I need that every time setInterval trigger it execute a query at the end return to the first.
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);
it even works but of the problem of CORS. strange that I put without the setInterval it not of the problem of Cors.
– Ezequiel Tavares