.when is a jQuery function for executing a function when the included AJAX request(s) have been completed. It usually precedes .then.
.when
is a jQuery function for executing a function when the included AJAX request(s) have been completed. It usually precedes .then
. An example of a usage would be:
$.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.
*/
});