Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#441 closed defect (fixed)

IFrameIO with text/html not working properly

Reported by: hww3@… Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

When using IFrameIO with a mime-type of text/html, the returned data isn't actually returned (I'm under the impression that the contents of the first textarea field element are returned as data to the load function). Actually, a variant on this would work better even if it's not the case.

The following code snippet added to the appropriate place in dojo.io.IFrameIO.iframeOnLoad() fixes the problem (at least on mozilla), the first line is a good marker for location:

replace:

else{ text/plain

value = ifw.innerHTML;

}

with:

else{ text/plain

var doc = ifw.document; var e = doc.getElementsByTagName("textarea"); if(e.length) value = e.item(0).innerHTML;

}

Thanks!

Bill Welliver hww3@…

Change History (4)

comment:1 Changed 13 years ago by hww3@…

Milestone: 0.2.2release0.3release
Version: 0.20.3

actually, it turns out that certain browsers encode html contained within a textarea element, so you can't just get the contents of a textarea and stick it someplace else; the html elements have been converted with > and so forth.

I don't confess to understand the origins of the technique, but it does seem that using a div as the "holder" for the returned value will work better than a textarea.

So, in my example solution, replacing "textarea" with "div" seems to work better.

comment:2 Changed 13 years ago by skinner

Milestone: 0.3release0.4

comment:3 Changed 13 years ago by James Burke

Resolution: fixed
Status: newclosed

This was fixed in 0.3.1, but not in the manner suggested by this bug. The HTML document object is returned. See this test file:

http://archive.dojotoolkit.org/nightly/tests/io/test_IframeIO.html.html

comment:4 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.