title: Javascript: XHR not handling multiple async requests
body: <p>Hi I am trying to access one resource multiple times with with different parameters</p>
  
  <p>In this case requesting</p>
  
  <pre><code>    var domains = [
      'host1',
      'host2'
      ];
  
      var requests = new Array();
  
      for ( i in domains )
      {
          requests[i]=new request(domains[i]);
      }
  
      function request(site)
      {
          var url = 'get_remote_status.php?host='+site;
          var queues = {};
          http_request = new XMLHttpRequest();
          http_request.open("GET", url, true, 'username', 'password');
          http_request.onreadystatechange = function () {
              var done = 4, ok = 200;
              if (http_request.readyState == done &amp;&amp; http_request.status == ok) {
                  queues = JSON.parse(http_request.responseText);
                  var queuesDiv = document.getElementById('queues');
                  print_queues(queues, queuesDiv, site);              
              }
          };
          http_request.send(null);
      }
  </code></pre>
  
  <p>However, only one of of the requests is being handled by the code lambda. Chromium reports that both requests have been received and is viewable in the resourced pane.</p>
  
  <p>Also if I make the request synchronous then it works fine. However this is not acceptable to the release code as a request may timeout.</p>
  
  <p>Thanks</p>