I can't figure how to loop through an array of urls and pass them to getJSON
, to finally return the new array of datas.
var data_num=[];
$.each(arr_urls, function( index, value ) {
$.getJSON(arr_urls[index], function (data) {});
data_num.push(data);
});
alert(data_num);
var data_num=[];
$.each(arr_urls, function( index, value ) {
$.getJSON(arr_urls[index], function (data) {
data_num.push(data);
alert(data_num);
});
});
Put your pusher and alert in the callback like this.