Reading a JSON-Service like this:
$.ajax({
url:\'activeIDs\',
success : function(data){ // data = [14,15]
var tableRows = [];
for (var dataIndex=0; d
Use jQuery when
// Function to return id info based on this example http://stackoverflow.com/questions/5316697/jquery-return-data-after-ajax-call-success
function getInfo(ID) {
return $.get("info?id=" + ID);
}
// based on examples from https://api.jquery.com/jQuery.when/
var promises = [];
var jqxhr = $.get("activeIDs")
.done(function(data) {
$.each(data,function(i,v) {
promises.push(getInfo(v));
});
$.when(promises).done(function(p) {
console.log(p,p.length);
});
})
.fail(function() {
alert( "Error" );
});