Opened 6 years ago

Last modified 2 years ago

#16440 assigned defect

dojo/request/iframe.js, xmlText is undefined error in FF and IE9

Reported by: taoyan Owned by: dylan
Priority: undecided Milestone: 1.15
Component: IO Version: 1.8.1
Keywords: Cc:
Blocked By: Blocking:

Description

I use dojo.io.iframe.send to upload attachment, after upgrading Dojo from 160 to 181, there is a "xmlText is undefined" error in FF or IE9, but works well in IE8. I compare codes between Dojo 160 and 181 and find, the error is in dojo/request/iframe.js, handleResponse method

if(handleAs !== 'html'){

if(handleAs === 'xml'){

IE6-8 have to parse the XML manually. See http://bugs.dojotoolkit.org/ticket/6334

if(doc.documentElement.tagName.toLowerCase() === 'html'){

query('a', doc.documentElement).orphan();

var xmlText = doc.documentElement.innerText;

xmlText = xmlText.replace(/>\s+</g, '><');

response.text = lang.trim(xmlText);

}else{

response.data = doc;

}

......

in FF, IE9 or Chrome, doc.documentElement.innerText is undefined. Dojo 160, dojo/io/iframe.js, send method

if(handleAs != "html"){

if(handleAs == "xml"){

FF, Saf 3+ and Opera all seem to be fine with ifd being xml. We have to

do it manually for IE6-8. Refs #6334.

if(dojo.isIE < 9
(dojo.isIE && dojo.isQuirks)){

dojo.query("a", dii._frame.contentWindow.document.documentElement).orphan();

var xmlText=(dii._frame.contentWindow.document).documentElement.innerText;

xmlText=xmlText.replace(/>\s+</g, "><");

xmlText=dojo.trim(xmlText);

......

to prevent this kind of error, but in Dojo 181 it changes to

if(doc.documentElement.tagName.toLowerCase() === 'html')

is it a bug? if not, is there a document about how to use this feature? Thanks!

Change History (3)

comment:1 Changed 6 years ago by bill

Component: GeneralIO
Owner: set to Bryan Forbes

comment:2 Changed 3 years ago by dylan

Milestone: tbd1.12
Owner: changed from Bryan Forbes to dylan
Status: newassigned

comment:3 Changed 2 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.