Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post

    outerText/Html of the intire document?

    hey how do you get the html, or text of the intire document or body

    ,

    so just getting the source code of the page
    Kris Hubby
    kwhubby site

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try this:

    alert(document.getElementsByTagName('HTML')[0].outerHTML)
    Don't resist to assimilation. Billions of Borgs can't be wrong!

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post

    Thumbs up

    thanks , i never thought of going back to the html tag
    Kris Hubby
    kwhubby site

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    document.documentElement would also refer to the <html> element in an HTML document.

  • #5
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    how would you do that with a frame, or iframe

    (eg named asdf)

    would it be (for an iframe)
    alert(document.all.asdf.document.getElementsByTagName('HTML')[0].innerHTML)
    Kris Hubby
    kwhubby site

  • #6
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    for an iframe, i think that:

    alert(asdf.document.getElementsByTagName('HTML')[0].innerHTML)

    is enough
    Don't resist to assimilation. Billions of Borgs can't be wrong!

  • #7
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    is there a way to do that if the iframe is browsed to a text document, not an html file. So I don't have to start at the <html> tag.. (of course its all on the same server so it won't couse permision errors for cross domains)

    edit:
    nm, it worked anyway with a text document!!
    Last edited by kwhubby; 02-22-2003 at 03:09 AM.
    Kris Hubby
    kwhubby site


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •