app = {
init(){
$.when(
this.loadXXX(),
this.loadYYY()
)
},
loadXXX(){
let dtd = $.Deferred();
$.ajax({
...,
success:function(){
dtd.resolve();
}
});
return dtd;
},
loadYYY(){
let date = "";
return this.loadYYYHelper(date);
},
loadYYYHelper(){
let dtd = $.Deferred();
$.ajax({
...,
success:function(){
dtd.resolve();
}
});
return dtd;
}
}
其他信息自行百度