title: Confused about JQuery promises
body: <p>I'm really trying hard to understand the behavior or JQuery's promise().</p>
  
  <p>I want to do 3 (unrelated, but back-to-back) AJAX queries :</p>
  
  <pre><code>1. GET the user data
  2. POST an image
  3. POST another image
  </code></pre>
  
  <p>Then, I'm doing a load of things that are based on then results of said queries.</p>
  
  <p>Now, the $.when(ajax, ajax, ajax).then(userData, img1, img2) functions work great for this as of now, <strong>but</strong> what if I want my ajax calls to be wrapped around conditions, as so :</p>
  
  <pre><code>$.when(
   if(...){
     $.ajax({ ...GET user data... });
   }
   if(...){
     $.ajax({ ...POST image... });
   }
   if(...){
     $.ajax({ ...POST image... });
   }
  ).then(function(userData, img1, img2){
   if(img1){
    ...do something with img1...
   }
   ...same for other responses...
  });
  </code></pre>
  
  <p>I'm aware that my code doesn't contain any promise, but really, everything I've tried failed pretty badly in this scenario.</p>
  
  <p>Any hint/tip appreciated. Thanks.</p>