Currently I have a function like this:
a: function (val) {
ajaxcall.done(function() {
console.log("Done");
}
}
I want to write another function which calls a
, then wait until a
is done (so the stuff inside the .done()
executes, then it'll continue with the rest. Something like this:
console.log("beginning");
a("test");
console.log("End");
Would that print out
beginning
done
end
or would it sometimes be
beginning
end
done
depending on if the ajax calls take a long time?