View Full Version : outerText/Html of the intire document?
kwhubby
02-21-2003, 05:58 AM
hey how do you get the html, or text of the intire document or body
,
so just getting the source code of the page
Borgtex
02-21-2003, 11:27 AM
try this:
alert(document.getElementsByTagName('HTML')[0].outerHTML)
kwhubby
02-21-2003, 09:24 PM
thanks :) , i never thought of going back to the html tag
document.documentElement would also refer to the <html> element in an HTML document. :)
kwhubby
02-21-2003, 09:31 PM
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)
Borgtex
02-22-2003, 12:10 AM
for an iframe, i think that:
alert(asdf.document.getElementsByTagName('HTML')[0].innerHTML)
is enough
kwhubby
02-22-2003, 02:04 AM
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!!
:D
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.