Web Design and Development Forums

Printing a piece of a webpage

This is a discussion on "Printing a piece of a webpage" within the JavaScript Forum section. This forum, and the thread "Printing a piece of a webpage are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > JavaScript Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 18th, 2008, 14:51   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: New Jersey
Posts: 3
Printing a piece of a webpage

Hello,

I work for a company that is looking to put its safety manual online. Each page of the site contains subsections:

400.1
blahblahblahblahblah

400.2
blahblahblahblah

...

400.n
blahblahblah

I would like to, upon clicking an icon next to the heading, open a new window with the heading and the html underneath it, to allow one to easily print out sections of the safety manual. I've been searching for a solution, and have so far come up blank. Does anyone have any ideas how this might be done?
lightningjim is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 20th, 2008, 05:46   #2 (permalink)
Nerdy Moderator
 
CloudedVision's Avatar
 
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 520
Blog Entries: 4
Re: Printing a piece of a webpage

Do you want a print button or a printer-friendly page?

The print button isn't gonna work, you'll just have to give them instructions in there browser. The printer-friendly page should be done manually or with a server side scripting language. (eg: PHP)
__________________
Take it easy

Other Road Design

WebForumz Moderator: HTML | Javascript | PHP
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 21st, 2008, 13:33   #3 (permalink)
Moderator
 
spinal007's Avatar
 
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,609
Blog Entries: 1
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Printing a piece of a webpage

I think I see where you're going and it can be done as long as each heading has its relevant content within a corresponding DIV, with some sort of ID.

Example: (hand coded on the fly, not tested, but you'll get the gist)
Code: Select all
<h2 id="SectionX" onclick="PrintSection(this)">Section X</h2>
<div id="SectionXContent"> blah blah blah </div>
<script>
function PrintSection(section){
 var wind = window.open('about:blank');
 var html = document.getElementById(section.id + 'Content').innerHTML;
 wind.document.body.innerHTML = html;
 wind.print();
}
</script>
__________________
Diego - SEO Consultant London (My Blog | Fight Me)
jQuery: Star Rating - Multiple File Upload - FCKEditor/Codepress
Before we work on artificial intelligence why don't we do something about natural stupidity?
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
any ideas for this piece saltedm8 Website Planning Discussion 5 Feb 5th, 2008 08:08
Paypal API Script, this is a superb piece of software paying instant commission allergate Link Building and Link Sales 0 Mar 3rd, 2007 16:41
printing spinal007 CSS Forum 2 Nov 17th, 2004 13:37



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 19:17.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59