i am gonna put this part on hold for now as its taking too much time.
but i came up with this code upto now:
- if (xmlHttp.busy) {
-
xmlHttp.queue[xmlHttp.queue.length] = this.functionName;
-
} else {
-
xmlHttp.caller = this;
-
xmlHttp.open(url, 'GET', true);
-
xmlHttp.onreadystatechange = function () {
-
if (xmlHttp.readystate == 4) {
-
// code to handle response here
-
if (xmlHttp.queue.length > 0) {
-
xmlHttp.queue[0]();
-
} else {
-
xmlHttp.busy = false;
-
}
-
}
-
}
-
}
now two requests wont be sent simultanously.
You could keep an index for each created object. This would require you to create an object for the requests and increment each time a request is made.
i already have a parent object that stores an array of the objects that makes the call.
Do you mean i have to make an XMLHttpRequest object for each of the objects. When i do this i cant seem to find any reference to the parent of the event
(event meaning the this.xmlHttp.onreadystatechange which is a 'xpconnect' something object as on firebug)
Can you explain more with some code?