jQuery Deferred object  callback args & dynamically building?
<p>I saw this code at jQeury Site : </p>

<pre><code> 1:  var jqxhr = $.ajax( "example.php" )
        .done(function() { alert("success"); })
        .fail(function() { alert("error"); })
        .always(function() { alert("complete"); });

   2: // perform other work here ...

     // Set another completion function for the request above
   3:  jqxhr.always(function() { alert("second complete"); });
</code></pre>

<hr>

<h2>2 Questions :</h2>

<p><strong>1)</strong> I heard that the callback functions <strong>arguments</strong> of <code>success</code> , <code>error</code> , <code>complete</code> being transferred  to <code>done</code> , <code>fail</code> , <code>always</code> respectively.</p>

<p><img src="http://i.stack.imgur.com/j4vi1.jpg" alt="enter image description here"></p>

<p>So If I want to use the <strong>jqXHR</strong> obj in  always callback , How can i know from where he came (<code>error</code> or <code>success</code>) - because the <code>params order</code> in the method signature is <strong>different</strong> !!!</p>

<pre><code>//here it is at place 3
</code></pre>

<p><img src="http://i.stack.imgur.com/DrFGl.jpg" alt="enter image description here"></p>

<pre><code>//here it is at place 1
</code></pre>

<p><img src="http://i.stack.imgur.com/D3k57.jpg" alt="enter image description here"></p>

<hr>

<p><strong>2)</strong> I also heard that Defered Objects help us to build the callback Function dynamically.
(as we can see in '<code>3:</code>')</p>

<p>I dont understant why will I ever need it ? by the time I got the Section <code>3:</code> - the ajax call has <strong>already</strong> been made and alerted completed , In what scenarios  the section <code>3:</code> comes into action ?</p>
