Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > innerHTML equivalent of an iframe element?

Reply
Thread Tools

innerHTML equivalent of an iframe element?

 
 
tsukasakun@gmail.com
Guest
Posts: n/a
 
      04-22-2007
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!

 
Reply With Quote
 
 
 
 
shimmyshack
Guest
Posts: n/a
 
      04-22-2007
On 22 Apr, 23:35, (E-Mail Removed) wrote:
> 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

 
Reply With Quote
 
 
 
 
Peter Michaux
Guest
Posts: n/a
 
      04-23-2007
On Apr 22, 3:35 pm, (E-Mail Removed) wrote:
> 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

 
Reply With Quote
 
tsukasakun@gmail.com
Guest
Posts: n/a
 
      04-23-2007
On Apr 23, 1:25 am, shimmyshack <(E-Mail Removed)> wrote:
> 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.

On Apr 23, 2:10 am, Peter Michaux <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
tsukasakun@gmail.com
Guest
Posts: n/a
 
      04-23-2007

On the other hand, it seems somebody already "stole" my idea for
simpler AJAX

 
Reply With Quote
 
tsukasakun@gmail.com
Guest
Posts: n/a
 
      04-23-2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
standards-compliant equivalent of innerHTML Andy Fish Javascript 23 12-09-2009 10:23 AM
xhtml, innerHtml, appendChild, and innerHTML. what is the exact proper way to do this with DOM sonic Javascript 5 07-11-2006 08:17 AM
Retieve InnerHTML from an IFrame on the Server Side. L Anthony Johnson ASP .Net 4 06-16-2005 07:46 AM
simple iframe, calling with innerHTML - what am i doing wrong here? Ragnorack67@hotmail.com HTML 9 03-04-2005 07:27 AM
Get form values from iframe (1) to iframe (2) inside a layer in iframe (1) Daedalous Javascript 3 01-16-2004 11:08 AM



Advertisments