title: Are multiple simultaneous Ajax request possible?
body: <p>I am new to jquery and Ajax and I have the following question.</p>
  
  <p>Are multiple Ajax request allowed? I use PHP and I would like to have form submit via jquery Ajax and at the same time trigger another Ajax request that would do another task. All of this without the user waiting for every request to complete.</p>
  
  <p>Is this possible?</p>
  
  <p>Thanks for the help guys!</p>
  
  <p><strong>*   Edit   *</strong>
  I tried it but if i try to redirect the browser to another page it waits until ajax completes before moving on.</p>
  
  <p>this is the code for my test.</p>
  
  <pre><code>   /* populate subcategory dropdown based on category select */
  $('#categoria-selector').change(function (e) {
      var cat = $("#categoria-selector option:selected").text();
      alert(cat);
  
      $.ajax({
          type: "POST",
          url: baseurl + 'precios/test',
          success: function (data, status, xhr) {
              alert('second alert');
          }
      });
  
      $.ajax({
                  type: "POST",
                  url: baseurl + 'precios/test2',
                  success: function (data, status, xhr) {
                      alert('third alert');
                  }
              });
  });
  </code></pre>
  
  <p>On my controller i have the following functions</p>
  
  <pre><code> function test() {
          //sleep for 5 seconds
          $first = date('Y-m-d H:m:s');
          sleep(10);
          $second = date('Y-m-d H:m:s');
  //start again
          $_SESSION['mivar'] = 'Started at ' . $first . ' and ended at ' . $second;
      }
  
      function test2() {
          //sleep for 5 seconds
          $first = date('Y-m-d H:m:s');
          sleep(30);
          $second = date('Y-m-d H:m:s');
  //start again
           $_SESSION['mivar2'] = 'Started at ' . $first . ' and ended at ' . $second;
      }
  </code></pre>