JSFiddle - React, Tailwind, and code Playground
JavaScript
$(document).ready(function() {
var counter = 0;
// you can start all your 5 requests.
$.ajax({
url : url0,
async : true,
dataType : 'json'
success: function(data) {
// increment counter
counter++;
// do something with the data
}
});
// every 100ms check to see if all the objects are loaded
var t = setInterval(function() {
if (counter == 5) {
clearInterval(t);
// build graphs here
}
}, 100);
});