innerHTML equivalent of an iframe element?

T

tsukasakun

Is it possible to get the contents of an iframe (I need a method that
allows me to get the generated HTML code of an XML file that was
transformed by an XSL file)?


Thanks in advance! :)
 
S

shimmyshack

Is it possible to get the contents of an iframe (I need a method that
allows me to get the generated HTML code of an XML file that was
transformed by an XSL file)?

Thanks in advance! :)

have you thought to transform the xml to json and just push it to a
handler in the parent frame ala googlemail
 
P

Peter Michaux

Is it possible to get the contents of an iframe (I need a method that
allows me to get the generated HTML code of an XML file that was
transformed by an XSL file)?

Thanks in advance! :)

I've just been reading the YUI connection library <URL:http://
developer.yahoo.com/yui/connection/>. The library has the following
two lines of code to read the contents of an iframe when the iframe
has finished loading. "io" is the frame, and "obj" is just where they
want to store the contents of the frame.

obj.responseText = io.contentWindow.document.body ?

io.contentWindow.document.body.innerHTML :
null;
obj.responseXML = io.contentWindow.document.XMLDocument ?

io.contentWindow.document.XMLDocument :
io.contentWindow.document;

I really don't know the quality of these two lines of code.
Determining that is my next job. Anyone have any thoughts?

Peter
 
T

tsukasakun

have you thought to transform the xml to json and just push it to a
handler in the parent frame ala googlemail
But the entire point of doing it this way is have the browser use its
built-in XSL transformation, so that I don't have to do it with a
JavaScript library like Sarissa. This makes the site considerably
lighter since it's all part of the browser.

I've just been reading the YUI connection library <URL:http://
developer.yahoo.com/yui/connection/>. The library has the following
two lines of code to read the contents of an iframe when the iframe
has finished loading. "io" is the frame, and "obj" is just where they
want to store the contents of the frame.

obj.responseText = io.contentWindow.document.body ?

io.contentWindow.document.body.innerHTML :
null;
obj.responseXML = io.contentWindow.document.XMLDocument ?

io.contentWindow.document.XMLDocument :
io.contentWindow.document;

I really don't know the quality of these two lines of code.
Determining that is my next job. Anyone have any thoughts?

Peter
Thanks, I haven't thought of that :) I'll give it a try in a few
hours ;p
 
T

tsukasakun

Oh er, shimmyshack, it seems I misunderstood you.

That would be a pretty good idea, yes, but the HTML that you get as a
result is supposed to be taken and put in a container in the parent
frame via DOM or innerHTML :p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top