Я использую jQuery 1.5
function doAjax(){
return $.get('ajax.php');
}
function doMoreAjax(){
return $.get('ajax.php');
}
$.when( doAjax(), doMoreAjax() ).then(function(){
console.log( 'I fire once BOTH ajax requests have completed!' );
}).fail(function(){
console.log( 'I fire if one or more requests failed.' );
}).success(function(){
console.log( 'I fire if all requests success.' ); //It not works for me
})
Вопрос: Я не могу использовать функции success
и error
с $.when
, поскольку $ .when или $ .ajax одинаковы.
я могу использовать success
и error
с $.ajax
, почему я не могу использовать с $.when