title: Parallel asynchronous Ajax requests using jQuery
body: <p>I'd like to update a page based upon the results of multiple ajax/json requests. Using jQuery, I can "chain" the callbacks, like this very simple stripped down example:</p>
  
  <pre><code>$.getJSON("/values/1", function(data) {
    // data = {value: 1}
    var value_1 = data.value;
  
    $.getJSON("/values/2", function(data) {
      // data = {value: 42}
      var value_2 = data.value;
  
      var sum = value_1 + value_2;
  
      $('#mynode').html(sum);
    });
  
  });
  </code></pre>
  
  <p>However, this results in the requests being made serially. I'd much rather a way to make the requests in parallel, and perform the page update after all are complete. Is there any way to do this?</p>