Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get entire content of page?

So is it possible to snag the entire content of a page in its current state. For example, if interacting with a page, via jquery, I've modified the document by either inserting content, or by adding or removing class names. Is it possible to get the markup of this document in its current form from starting html tag to html tag?

like image 257
David Avatar asked May 14 '09 22:05

David


2 Answers

Something like

document.documentElement.innerHTML

This doesn't include the <html> opening and closing tags

like image 181
David Snabel-Caunt Avatar answered Oct 30 '22 16:10

David Snabel-Caunt


Can't you just get the root object in the DOM and call innerHTML to get it all?

like image 35
Lloyd Avatar answered Oct 30 '22 15:10

Lloyd