IE(6,7) and XmlHttpRequest (bug in IE?)

Hi everyone. I'll try to be short as possible. (This is not actually problem, I've resolved the issue)

I have some javascript function which I call like this:

DoXHRequest("somepage.asp", "POST", params, TheCallbackFunction);

DoXHRequest is defined something like this:

xmlHttp is XmlHttpRequest properly defined elsewhere.

function DoXHRequest(url,params, CallbackMethod)

{

xmlHttp.onreadystatechange= CallbackMethod;

xmlHttp.open("GET", url+"?"+ params,true);

xmlHttp.send(null);

}

that function is called for example in some "onclick" handler for button (or anything else)
in callback there is usual... if (xmlHttp.readyState == 4) { do something }

However, this works ok in IE(6,7) only first time clicked, on second click xmlHttp never gets (again) to readyState 4 (or never invokes callback method again?).
In Firefox everything works perfectly.

Now, if I add xmlHttp.abort() at the end of callback function and IE works ok.

(as I understood abort() in some manner "resets" xmlhttprequest object?)

All I need to know if this is bug in IE or I am doing something wrong?

[2751 byte] By [RSSole] at [2008-1-10]