我正在使用Deferred.Done方法,它又被另一個jQuery函數調用,返回deferred.done,不從函數返回
但即使點(a){return false}被擊中它仍然去點(b),
我在做什麼嗎?..
function InitialMethod(isInitialCallToMethod) {
//Call using deferred method
CheckUserSession()
.done(function (isSessionAvailable) {
//Session data exists for end user.
if (!isSessionAvailable) {
//reopen modal to get user details
OpenUserSessionModal();
return false; --(a)
}
})
.fail(function (error) {
//reopen modal to get user details
OpenUserSessionModal();
//open failure div to notify user
OpenJqueryPopup('#divDialogFailure');
return false;
});
//Is method called for the first time,after document load?
if (isInitialCallToMethod) {
//bind elearning tabs
CreateElearningTabs();
}
return true; ---(b)
}
爲什麼不應該這樣?你從回調中返回一個值,而不是'createElearningTabs()'函數。 – Sirko
沒有得到它@Sirko ..我已經從.Done事件返回false! –