0
我使用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
因爲$。當或$就相同。
我可以使用success
和error
與$.ajax
爲什麼我不能用$.when
我對這個問題感到困惑。你要多少個甜甜圈? – Jason 2011-02-02 05:00:51