Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Browsers / Internet Explorer / February 2004



Tip: Looking for answers? Try searching our database.

Printing the document object...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Allen - 25 Feb 2004 12:45 GMT
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>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.