Hey there, I'm currently attempting to access a single resource multiple times with various parameters. Here's what I have so far:
Essentially, I am making requests for the following domains:
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 && http_request.status == ok) {
queues = JSON.parse(http_request.responseText);
var queuesDiv = document.getElementById('queues');
print_queues(queues, queuesDiv, site);
}
};
http_request.send(null);
}
However, it seems that only one of these requests is being processed by the code lambda. While Chromium indicates that both requests have been received and are visible in the resources pane.
If I switch the request to synchronous, it works fine. But this approach is not suitable for the release code as a request may time out.
Thank you for your help.