I am attempting to make multiple http get requests in js. but I'm a total noob. I would not be opposed to jQuery either. The idea is I make a call to my server so I can populate a js chart.
var client;
function handler() {
if(client.readyState == 4 && client.status == 200) {
// make a chart
}
}
window.onload = function() {
client = new XMLHttpRequest();
client.onreadystatechanged = handler;
client.open("GET", "http://someurl/stuff");
client.send();
}
so the above is the basic idea of a web request. It seems that the handler acts a callback or event. this works when creating one get request. but if I make two or more, then I get mixed results. sometimes all requests will work, other times none, or just one. the error that occurs is the connection has not been closed.