Serial downloading pictures from the server?

I get an array of IDs of the images, and then sequentially load images by id
but Ajax is asynchronous and the first picture that is inserted,which first will be downloaded
but if I turn off asynchron the pictures are inserted only when load LAST
how do I do that is that they are loaded alternately?
April 19th 20 at 12:03
2 answers
April 19th 20 at 12:05
function load(){
 //handling Ajax request in case of success, cause once again, load(),
 //but for the following pictures
April 19th 20 at 12:07
You can first mark the place to insert, then insert instead of tagging.
placeholder - marks the spot. You need to check that an empty span is not visible in the carousel, otherwise it will need to be replaced by something invisible.
After uploading the image - it is designed to replace the placeholder div.
As something like this
$each(msg, function(index,value){
 var placeholder=$('<span></span>').appendTo('.carousel-inner');
 placeholder.replaceWidth('<div class...

Find more questions by tags jQueryJavaScript