我正在使用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! –