JS异步编程该怎么写更优雅

2024-12-17 16:00:00
推荐回答(1个)
回答1:

var ajax1 = $.ajax(url);
var ajax2 = $.ajax(url);
var ajax3 = $.ajax(url);
$.when(
ajax1, ajax2, ajax3
).then(function(data){
console.log(data);
clearPassword();
});