Ajax API calls in loop need to be executed in order
lets say you have a scenario where you needed to create a .csv output in a page's textarea... So I have an array of queries which i loop. Inside the loop im passing a query to an ajax call... I need to append the result of the ajax call into the textarea. My question is how do you get the results printed out in the order they are requested (basically the order in the queries array) //example array to loop. var queries= ['query1', 'query', 'query3', 'query4']; //the textarea where im going to print the results in order later to open in excel as a .csv file var $csvText= $('#some-text-area'); /