[jQuery] Detect when all ajax queries launched by "for" have finished

[jQuery] Detect when all ajax queries launched by "for" have finished


Hello,
I've got a script that takes all the elements of a list and on click of
a button it runs an ajax query for each item. It all works fine however
I would like to have a "searching" message during the search and a
"finished" message after the search has finished, but I can't think how
to detect when the for cycle has finished and all ajax queiries ...
Here's the code :