title: How to check if ajax call exists using jQuery?
body: <p>I know my title isn't very clear.</p>
  
  <p>For example, this is the structure of my code:</p>
  
  <pre><code>if (foo == something) {
    // Ajax call 1, let it be $.ajax("foo1.html") and so on
  } else {
    // Ajax call 2, let it be $.ajax("foo2.html") and so on
  }
  </code></pre>
  
  <p>How would I test if <code>$.ajax("foo1.html")</code> has actually been run?</p>
  
  <p>Please don't tell me to test if <code>foo == something</code> again. My actual code is much, much more complicated, so please answer the question from the view of the ajax call.</p>
  
  <p>Is this possible at all?</p>