Javascript module pattern, ajax functions callbacks
<pre><code>var ajaxStuff = (function () {

    var doAjaxStuff = function() {
      //an ajax call
    }

    return {
       doAjaxStuff : doAjaxStuff 
    }

})();
</code></pre>

<p>Is there any way to make use of this pattern, and fetch the response from a successful ajaxcall when calling my method? Something like this:</p>

<pre><code>ajaxStuff.doAjaxStuff(successHandler(data){
    //data should contain the object fetched by ajax
});
</code></pre>

<p>Hope you get the idea, otherwise I'll elaborate.</p>
