R
Robloche
Hi,
I wrote a class to handle requests from the client-side. In particular,
I use :
fuction myClass() {
// ...
this.xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
// ...
}
In the first implementation of this class, I only instantiated
this.xhr_object (as shown above) once, when a "myClass" object was
created. But then, it happened that I couldn't perform more than one
request with this object : from the second request, the function
onreadystatechange would never be called (I made many tests to be sure
of that).
So I changed my class and now I create a new object (with
this.xhr_object = new ActiveXObject("Microsoft.XMLHTTP") every time a
request is made. And it works.
So my question is :
Is this behavior normal or have I miss something ?
(In fact, my class is a wrapper for IE and Firefox and under Firefox
this problem doesn't exist : Once you have your HTMLHttpRequest object,
you can make as many requests as you want.)
Thank you all for your (future) answers !
I wrote a class to handle requests from the client-side. In particular,
I use :
fuction myClass() {
// ...
this.xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
// ...
}
In the first implementation of this class, I only instantiated
this.xhr_object (as shown above) once, when a "myClass" object was
created. But then, it happened that I couldn't perform more than one
request with this object : from the second request, the function
onreadystatechange would never be called (I made many tests to be sure
of that).
So I changed my class and now I create a new object (with
this.xhr_object = new ActiveXObject("Microsoft.XMLHTTP") every time a
request is made. And it works.
So my question is :
Is this behavior normal or have I miss something ?
(In fact, my class is a wrapper for IE and Firefox and under Firefox
this problem doesn't exist : Once you have your HTMLHttpRequest object,
you can make as many requests as you want.)
Thank you all for your (future) answers !