Edit in JSFiddle

var deferred = $.Deferred();

deferred.resolve("hello world");

deferred.done(function(value) {
    alert(value);
});