473,511 Members | 16,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to print in javascript

1 New Member
hi all

i have a paragraph under a div section in my html page.
i need to print those details alone using print method

<div>ggggggggggggggggg
</div>


<div>aaaaaaaaaaa
</div>


if i want to print only gggggggggggggg then how should i do it by print method in javascript. by the way i should not open any new window and write this content to it. How abt using focus() method . Please help me in this regard

Kannan.S
Aug 10 '07 #1
1 1326
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

To print only a div section, hide the rest of the page when printing using the display property set to "none". Alternatively, you can use CSS print stylesheets.
Aug 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
107747
by: Brian Hanson | last post by:
Hi, I am trying to write a javascript function that gets called from a within an asp.net application to print a pdf file(s) programmatically. I am a pretty experienced developer in several...
3
9402
by: Marcus Bjorke | last post by:
I use a print link that causes a problem with Opera 7. The link looks like this <a href="javascript:parent.frames.mainFrame.print()">Print this page</a> I also used <a...
4
2159
by: Julie Siebel | last post by:
Apologies...I'm sure this has been asked before, but I can't seem to come up with the correct Google search terms. While my problem is with stylesheets, the errors are being caused by my...
2
4653
by: Rob McLennan - ZETLAND | last post by:
Hi, I have set up an external stylesheet, named "print.css", to format the style of all pages printed from my company's website. I've been previewing my changes to the stylesheet by doing...
4
3213
by: Fred | last post by:
I'm a newbie to JavaScript so be gentle. You know that funky IE margin issue that causes the right side of the page to get cut off when the user prints the html document?...
4
2344
by: rom | last post by:
I need to print a html table when the user clicks on a key. the problem is that i don't want the printer dialog box to appear. i guess this is impossible in javascript so i think to create an...
4
1775
by: fredd00 | last post by:
Hi I have an aspx page that has a datagrid and a print button i have a javascript function : function PrintPage(){ if (window.print) {alert('print');window.focus(); window.print(); }...
6
3450
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page...
1
1974
by: Michael Repucci | last post by:
Hi all, minor newbie problem I hope you can help with, since I can't find the topic covered on line. Basically, I have a div section in my xhtml that I want visible for print (div {display:...
2
3013
by: bob | last post by:
Hi, I have a page that has a collection of things which it passes to a second 'print' page using a session variable. The print page has buttons for moving though the collection and the user ...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7355
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5066
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.