I'm trying to do the next thing: when first part finished (including the function AccountClicked
that gets details from the server), start the second part.
how can I do it please?
// first part
$('#accountsTable li input').each(function () {
isGetLastSearchOperation = true;
var accountId = $(this).attr('id');
if ($.inArray(accountId, LastSearchedAccountsIds) > -1) {
AreClickedButtonsEnable = true;
$(this).attr('checked', true);
AccountClicked(this);
}
// uncheck the other goals
else {
$(this).attr('checked', false);
}
});
// second part
$('#commercialGoalsTable li input').each(function () {
isGetLastSearchOperation = true;
var goalId = $(this).attr('id');
if ($.inArray(goalId, LastSearchedGoalsIds) > -1) {
AreClickedButtonsEnable = true;
$(this).attr('checked', true);
//CommercialGoalClicked(this);
}
// uncheck the other goals
else {
$(this).attr('checked', false);
}
});
any help appreciated!