.when
- это функция jQuery для выполнения функции, когда завершенные запросы AJAX завершены. Обычно это предшествует .then
. Пример использования:
$.when($.post(foo1), $.post(foo2)).then(function (a, b) {
/*
execute this when requests to foo1 and foo2 have been made. a[0] and b[0] contain
the results returned by the two pages foo1 and foo2.
*/
});