innerHTML equivalent of an iframe element?

Discussion in 'Javascript' started by tsukasakun@gmail.com, Apr 22, 2007.

  1. Guest

    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! :)
    , Apr 22, 2007
    #1
    1. Advertising

  2. shimmyshack Guest

    On 22 Apr, 23:35, 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
    shimmyshack, Apr 23, 2007
    #2
    1. Advertising

  3. On Apr 22, 3:35 pm, 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
    Peter Michaux, Apr 23, 2007
    #3
  4. Guest

    On Apr 23, 1:25 am, shimmyshack <> 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 <> 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
    , Apr 23, 2007
    #4
  5. Guest

    On the other hand, it seems somebody already "stole" my idea for
    simpler AJAX :(
    , Apr 23, 2007
    #5
  6. Guest

    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
    , Apr 23, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daedalous
    Replies:
    3
    Views:
    684
    Daedalous
    Jan 16, 2004
  2. sonic
    Replies:
    5
    Views:
    281
    Randy Webb
    Jul 11, 2006
  3. Replies:
    0
    Views:
    132
  4. Replies:
    3
    Views:
    92
  5. Andy Fish
    Replies:
    23
    Views:
    364
    Shidhin CR
    Dec 9, 2009
Loading...

Share This Page