Welcome visitor
* Login
* Register
It is currently July 19th, 2019, 6:30 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  Print Source Code
PostPosted: October 28th, 2009, 4:28 pm 

Posts: 16
Do you know if there's any tag or script to print the page source code? Something like print.source() or anything like that?


Top
 Profile  
 
  Re: Print Source Code
PostPosted: October 29th, 2009, 1:44 am 
User avatar

Posts: 112
I suggest you to put your source code inside a DIV with display attribute to none, and on the printing style sheet everything should be hidden but this div.

these styles shoul go inside your head tags
<style type="text/css" media="screen">
#sourceDiv{display:none} //this hides your div at the beginning
</style>
<style type="text/css" media="print">
img{display:none} //add the display none to all images and/or all the elemenets you want to hide
#sourceDiv{display:inline}
</style>


and this is an example for your div
<div id="sourceDiv">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;
&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;


&lt;/body&gt;
&lt;/html&gt;</div>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron