XMLHttpRequest second call always fail

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2010-05-08T15:01:06Z Indexed on 2010/05/08 15:08 UTC
Read the original article Hit count: 197

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about xmlhttprequest

Related posts about firefox