I have the following code:
var arrOutfit = []; // will be filled
...
$.when(
$.each(arrOutfit, function(key, sAdd) {
$.post('/checkout/addArticle', 'sAdd=' + sAdd + '&sQuantity = 1');
});
).then() {
// something
}
But this does not work. I figured that the array loop is invalid. As you can see I have mutliple ajax calls and I want to have just one callback, so I know, when all requests has been done. How can I achieve this?
Any ideas will be appreciated.
Best regards