title: Promote callback onSuccess return value to the Caller Function return value
body: <p>I have a javascript function that calls a generic function to make an ajax call to the server. I need to retrieve a result (true/false) from the callback function of the ajax call, but the result I get is always 'undefined'. </p>
  
  <p>A super-simplified version of the generic function without all my logic would be:</p>
  
  <pre><code>function CallServer(urlController) {
      $.ajax({
          type: "POST",
          url: urlController,
          async: false,
          data: $("form").serialize(),
          success:
              function(result) {
                  if (someLogic)
                     return true;
                  else
                     return false;
              },
          error:
              function(errorThrown) {
                  return false;
              }
      });
  }
  </code></pre>
  
  <p>And the function calling it would be something like:</p>
  
  <pre><code>function Next() {
          var result = CallServer("/Signum/TrySave");
          if (result == true) {
              document.forms[0].submit();
          }
      }
  </code></pre>
  
  <p>The "result" variable is always 'undefined', and debugging it I can see that the "return true" line of the callback function is being executed. </p>
  
  <p>Any ideas of why this is happening? How could I <em>bubble</em> the return value from the callback function to the CallServer function?</p>
  
  <p>Thanks</p>