title: Javascript AJAX function returns undefined instead of true / false
body: <p>I have a function that issues an AJAX call (via jQuery). In the <code>complete</code> section I have a function that says:</p>
  
  <pre><code>complete: function(XMLHttpRequest, textStatus)
  {
      if(textStatus == "success")
      {
          return(true);
      }
      else
      {
          return(false);
      }
  }
  </code></pre>
  
  <p>However, if I call this like so:</p>
  
  <pre><code>if(callajax())
  {
      //  Do something
  }
  else
  {
      // Something else
  }
  </code></pre>
  
  <p>The first is never called.</p>
  
  <p>If I put an <code>alert(textStatus)</code> in the <code>complete</code> function I get true, but not before that function returns <code>undefined</code>. </p>
  
  <p>Would it be possible to pass a callback function to my <code>callajax()</code> method? Like:</p>
  
  <p><code>callajax(function(){// success}, function(){// error}, function(){// complete});</code></p>