Opened 13 years ago

Closed 12 years ago

#575 closed defect (fixed)

[CLA] [fix provided] IE's responseXML (which gets called by dojo.io.bind()) does not really return xml doc when mimetype = "text/xml" and content-type != "text/xml"

Reported by: jose.a.martinez@… Owned by: alex
Priority: low Milestone: 0.9
Component: Core Version: 0.2
Keywords: dojo.io.bind xml text/xml application/xml ie internet explorer Cc: ktiedt@…
Blocked By: Blocking:

Description

I encountered this problem while trying to develop a script on my machine using the filesystem and not running a server. I was using dojo.io.bind() in this manner:

dojo.io.bind({
	url: "xmlfile.xml",
	mimetype: "text/xml",
	load: function(type, xml, e) {
		processXMLData(type, xml, e);
	}
});

On Firefox I did really get an XML document but when using IE I wasn't getting an XML document (I'm not sure what kind of object I got back, although it was a non-null object).

This is my proposed solution, I made this change in /src/io/BrowserIO.js to function doLoad(kwArgs, http, url, query, useCache):

}else if((kwArgs.mimetype == "application/xml")||
			(kwArgs.mimetype == "text/xml")){
	ret = http.responseXML;
	if(!ret || typeof ret == "string" || 
		/* Begin change */
		((http.getResponseHeader("Content-Type") != "text/xml")) && dojo.render.html.ie) { // This line was added by jose.a.martinez@gmail.com
		/* End change */
		ret = dojo.dom.createDocumentFromText(http.responseText);
	}
}

I added the check for Internet Explorer because I encountered this problem in IE. I'm not sure if any other browsers (besides Firefox) exhibit the same problem.

Change History (12)

comment:1 Changed 13 years ago by jose.a.martinez@…

Component: GeneralCore

comment:2 Changed 13 years ago by jose.a.martinez@…

small change to the code, I misplaced a logic statement.

}else if((kwArgs.mimetype == "application/xml")||
			(kwArgs.mimetype == "text/xml")){
	ret = http.responseXML;
	if(!ret || typeof ret == "string" || 
		/* Begin change */
		((http.getResponseHeader("Content-Type") != "text/xml") && dojo.render.html.ie)) { // This line was added by jose.a.martinez@gmail.com
		/* End change */
		ret = dojo.dom.createDocumentFromText(http.responseText);
	}
}

comment:3 Changed 13 years ago by alex

Milestone: 0.2.2release0.3release
Owner: changed from anonymous to alex
Status: newassigned

Jose: have you filed a CLA?

comment:4 Changed 13 years ago by jose.a.martinez@…

CLA? I don't know what that is. Can you provide more information or email me personally?

comment:5 Changed 13 years ago by James Burke

The CLA (Contributor License Agreement):

http://dojotoolkit.org/icla.txt

Some info on why the CLA is required:

http://dojo.jot.com/LicensingOverview

comment:6 Changed 13 years ago by Tom Trenka

Milestone: 0.3release0.4
Priority: normallow

Gonna push this back to 0.4; it's a really minor thing (IE with a filesystem is the issue), we can fix but we're inundated for 0.3.

comment:7 Changed 13 years ago by anonymous

severity: normalblocker

don't know why you changed the priority from normal to low.... AJAX is just not working with dojo in InternetEXplorer... that is a major bug to me. It makes dojo totally useless

comment:8 Changed 13 years ago by tk

Cc: ktiedt@… added

Not sure who the anonymous person is... but I'm emailing Jose to ask if he has filed a CLA or otherwise...

And to the anonymous poster, AJAX works in IE, my first dojo adventures were with dojo.io.bind in IE... and it worked back then...

-Karl

comment:9 Changed 13 years ago by tk

Summary: IE's responseXML (which gets called by dojo.io.bind()) does not really return xml doc when mimetype = "text/xml" and content-type != "text/xml"[CLA] [fix provided] IE's responseXML (which gets called by dojo.io.bind()) does not really return xml doc when mimetype = "text/xml" and content-type != "text/xml"

comment:10 Changed 13 years ago by dylan

Milestone: 0.40.4.1

comment:11 Changed 13 years ago by bill

Milestone: 0.4.10.5

comment:12 Changed 12 years ago by alex

Resolution: fixed
Status: assignedclosed

fixed in [9899]

Note: See TracTickets for help on using tickets.