xmlhttprequest/IServerXMLHTTPRequest2 created in framework.pack.js?

Hi,

Im trying to create a custom ajax request in Internet Explorer. About halfway my code i'm trying the following line:

xhr = new XMLHttpRequest();

Instead of getting a regular xmlhttprequest object I'm getting a “[object IServerXMLHTTPRequest2]” During the code in the line above a jump is made to the framework.pack.js and a ISserverXMLHTTPRequest2 is made, to the following lines in framework.pack.js:

XMLHttpRequest=function(){if(!_SARISSA_XMLHTTP_PROGID){_SARISSA_XMLHTTP_PROGID=Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"])
}return new ActiveXObject(_SARISSA_XMLHTTP_PROGID)
};

Is there a way to avoid this, I need a regular XMLHttpRequest object.

Edit: I should add: I'm using nuxeo 5.8 and IE11.

Thanks in advance, Bauke Roo

0 votes

1 answers

2519 views

ANSWER



It seems that it happened before with jQuery: http://fisheye.nuxeo.com/browse/nuxeo-dm/nuxeo-platform-webapp/src/main/resources/web/nuxeo.war/scripts/sarissa-ie-workaround.js?r=b9f3e6ef397a375151ed96a698ecdf311b8c94b7

the solution seems to be the following:

if (Sarissa.originalXMLHttpRequest) {
        xhr = new Sarissa.originalXMLHttpRequest();
    }else if (window.XMLHttpRequest) {
        xhr = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    xhr = new ActiveXObject("Microsoft.XMLHTTP");
}

Bauke Roo

0 votes