XMLHttpRequest second call always fail
- by Michael
I'm developing Firefox extension and inside of javascript module have function which looks like this:
var ajax = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
ajax.open('GET', url, true);
ajax.onload = function ()
{
if (ajax.readyState == 4 && ajax.status == 200)
{
...
}
}
ajax.onerror = function (e)
{
...
}
The second call to this function always fires onerror immediately... then after that the next call is successful. What could be wrong... is it normal?