jQuery("html").html() seems to retrieves most of it, except for the wrapping tag.
DOM is heavily modified, so original source is of not that much use.
- Is it reliable?
- Is it a good idea to just take jQuery's output and wrap ... around it? I can see at least some doctype problems here, and inclusion of scripts which shouldn't be rerun.
- Any better way?
EDIT: jQuery("").append(jQuery("html").clone()).html() almost works, except for doctype. Is there an easy way to get it?
EDIT 2: I need the doctype mostly to get proper quirk/almoststandards/standards mode. document.compatMode has half of it, is it enough?