JSFiddle - React, Tailwind, and code Playground
JavaScript
$(document).ready(function(){
var _q = ['/echo/json/', '/echo/json/', 'mybadurl'];
var _d = [];
for(u in _q)
{
$.ajax({
url: _q[u],
success: function(data){
pushData(data);
},
error: function(x){
pushData(x);
}
});
}
function pushData(d)
{
_d.push(d);
if(_d.length == _q.length)
{
alert('were done');
}
}
});