Is there a way to "print" the current document object using JavaScript?
What
I am trying to get is the current html of the page, which would include
any changes to it since it was loaded in the browser (for example, if a
radio
button was checked).
I could probably write a parser to take the document node and traverse it,
generating the html as I go along, but that seems like a lot of work.
Any ideas?
Thanks,
-- Greg Allen
gallen@arrayinc.com
Vic Sowers - 26 Feb 2004 11:13 GMT
> Is there a way to "print" the current document object using JavaScript?
> What
[quoted text clipped - 12 lines]
> -- Greg Allen
> gallen@arrayinc.com
Try:
<script language="JavaScript">
function HTML() {
popup = window.createPopup();
popup.document.body.style.backgroundColor = "lightyellow";
popup.document.body.style.border = "solid black 1px";
popup.document.body.style.padding = "5";
popup.document.body.innerText = document.body.outerHTML;
popup.show(100,100,500,700);
}
</script>
<button onclick="HTML()">HTML</button>