Somewhere else in code there's this:
function getMyDeferred() {
var deferred = $.Deferred();
$.ajax(url, {
success: function(data) {
deferred.resolve(data);
}
});
return deferred;
}
In my code, I'm accessing this method and getting a Deferred object. Is there any way to force it to wait at the current line until that deferred has been completed? I realize this is probably going against the whole philosophy of promises and deferreds, but can I do it? Something like this:
var deferred = getMyDeferred();
// do something here to ensure we do not proceed to the
// next step until deferred has been resolved
nextStep();