title: issue with sending ajax message
body: <p>Newbie to JQuery / JSON / AJAX so please be nice.</p>
  
  <p>I've pieced together this artwork from examples on SO and other sites, but I'm struggling.</p>
  
  <p>I've created some functions to deal with the AJAX response...</p>
  
  <pre><code>function newOrderSuccess(response) { ... }
  function newOrderTimeout() { ... }
  function newOrderFail() { ... }
  </code></pre>
  
  <p>...</p>
  
  <p>Here is the AJAX call:</p>
  
  <pre><code>function sendCallAjaxUsingJson(theUrl, theData, successCallbackFunction, timeoutCallbackFunction, otherErrorCallback, timeoutValueMilli)
  {
  var successFn = successCallbackFunction; 
  var timeoutFn = timeoutCallbackFunction; 
  var otherFn = otherErrorCallback;
  if(!(typeof successFn === 'function') || !(typeof timeoutFn === 'function') || !(typeof otherFn === 'function')) 
          return false;
  $.ajax({
          type: "POST",
          url: theUrl,
          timeout:timeoutValueMilli,
          dataType: 'json',
          data: { json: JSON.stringify(theData) },
          success:successFn(result),
          error: function(x, t, m) {
                     if(t==="timeout") {
                          timeoutFn();
                      } else {
                          otherFn();
                      }
                  }
      });
  </code></pre>
  
  <p>}</p>
  
  <p>My code calls the function as follows:</p>
  
  <pre><code>sendCallAjaxUsingJson("/ordertaker.php", 'submitOrder','newOrderSuccess', 'newOrderTimeout', 'newOrderFail',1000);
  </code></pre>
  
  <p>The result is..... nothing. I was getting to the <code>newOrderFail()</code> function before I uploaded the <code>ordertaker.php</code> file, but now I get nothing.</p>
  
  <p>Where did I go wrong?</p>