Javascript optional parameters for callbacks
<p>I want to do something like <code>$.ajax()</code> success and error callbacks.</p>

<p>This is what I have so far:</p>

<pre><code>var FileManager = {
            LoadRequiredFiles: function (onLoadingCallback, onCompleteCallback) {
                //Not sure what to do here
                this.OnLoading = onLoadingCallback;
                this.OnCompleteCallback = onCompleteCallback;

                this.OnLoading();
                this.OnComplete();
            },
            OnLoading: function () {
                //empty by default
            }
            OnComplete: function () {
                //empty by default
            }

};
//I want to do something like this:
FileManager.LoadRequiredFiles({OnLoading: function() {
            alert('loading');
       }
});
</code></pre>

<p>How do I fix this up properly? I'm using <code>FileManager</code> as my namespace.</p>
