Opened 14 years ago

Last modified 14 years ago

#5320 closed defect

xhrGet fails on IE 6/7 in some cases (most notable in local file load) — at Initial Version

Reported by: Jared Jurkiewicz Owned by: James Burke
Priority: high Milestone: 1.1
Component: IO Version: 1.0
Keywords: Cc: Jared Jurkiewicz, alex
Blocked By: Blocking:


xhrGet fails on IE 6/7 in some cases (most notable in local file load).

This issue was reported internally at my workplace. They were having problems getting xhrGet to work correctly on IE when loading files locally. The problem is actually in the xml handler. This is what they determined from investigation:

This one is related to and Although these two bugs marked fix, the code in 0.9 seems to be broken. The following is from xhr.js (or dojo.js.uncompressed.js), which parses XML from responseXML due to IE bug, if needed:

dojo._contentHandlers = {

...some code...

"xml": function(xhr){

if(dojo.isIE && !xhr.responseXML){

dojo.forEach(["MSXML2", "Microsoft", "MSXML", "MSXML3"], function(i){


var doc = new ActiveXObject(prefixes[i]+".XMLDOM"); doc.async = false; doc.loadXML(xhr.responseText); return doc; DOMDocument

}catch(e){ /* squelch */ };



return xhr.responseXML;



There is not a prefixes[] array defined, so you get an error at prefixes[i]+".XMLDOM". When changed to i+".XMLDOM", it fails again. The return call after loading of doc returns the anonymous function in dojo.forEach, not the function dojo._contentHandlers.xml and the loop continues and returns the wrong value.

This can be readily seen to fail just bu loading some dojox testcases locally. Sepcifically:

dojox/data/tests/runTests.html. The OpmlStore? and XmlStore? tests fail because they are XML based stores (and as such use handleAs: xml).

A patch is coming shortly for this issue. I just wanted to go ahead and get it opened now.

Change History (1)

Changed 14 years ago by Jared Jurkiewicz

Patch to xhr in base to fix IE bug.

Note: See TracTickets for help on using tickets.