我的 JavaScript 代码 -
function updateWhatIfPrivacyLevelRemove(recordId, correspondingDetailIDs) {
var ajaxCall = $.ajax({ data: { Svc: cntnrRoot,
Cmd: 'updateWhatIfPrivacyLevel',
updatePrivacyAction: 'Remove',
recordID: recordID
},
dataType: "text",
context: this,
cache: false
});
$.when(ajaxCall).then(updateWhatIfPrivacyLevelRemoveSuccess(recordID, correspondingResidentDetailIDs));
}
function updateWhatIfPrivacyLevelRemoveSuccess(recordID, correspondingResidentDetailIDs) {
//several other lines of non-related code
$.ajax({ data: { Svc: cntnrRoot,
Cmd: 'handleResidentRow',
recordID: 1,
active: 0
},
dataType: "text",
context: this,
cache: false
});
}
在我的 C# 代码中,我处理“updateWhatIfPrivacyLevel”和“handleResidentRow”的回调。我可以看出,handleResidnetRow 的 AJAX 回调是在 updateWhatIfPrivacyLevel 之前调用的。
为什么?