5, December 2008

How do you make a "print" button in javascript? - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  JavaScript
Topic: How do you make a "print" button in javascript?
« previous next »
Pages: [1] Print

Author Topic: How do you make a "print" button in javascript?  (Read 1050 times)
Credit Thief
.com pimp
*****
Posts: 1118
0 credits
Members referred : 0



« on: Aug 31, 2005, 03:53:26 PM »

Does anyone know the code.. I don't know javascript at alll but I can easily apply to my HTML.

Any help would be aprreciated

Proffesional nerd
War Hero
****
Posts: 283
556 credits
Members referred : 0



« Reply #1 on: Aug 31, 2005, 03:58:53 PM »

This might help :

Code:
<input type=button value="print this page" onClick="javascript:window.print();>"

Credit Thief
.com pimp
*****
Posts: 1118
0 credits
Members referred : 0



« Reply #2 on: Aug 31, 2005, 04:12:36 PM »

Actually I was thinking to have a link so when you click on the image, it opens the default printing program.

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8272
42619 credits
Members referred : 3



« Reply #3 on: Aug 31, 2005, 04:21:53 PM »

You can use it this way :

Code:
<a href="#" onClick="javascript:window.print();"><img src.........

if you want to print only the picture then you should create a new page with this content:

Code:
<html>
  <body onLoad="javascript:window.print();">
    <img src=myimage.gif>
  </body>
</html>

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
I wish I was an Oscar winner
**
Posts: 86
247 credits
Members referred : 0



« Reply #4 on: Aug 31, 2005, 05:45:00 PM »

That's nice. I will use it to my site too
Credit Thief
.com pimp
*****
Posts: 1118
0 credits
Members referred : 0



« Reply #5 on: Aug 31, 2005, 08:02:57 PM »

You can use it this way :

Code:
<a href="#" onClick="javascript:window.print();"><img src.........

Ok, thanks thats what i needed!

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=66
Tags : javascript html Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  JavaScript
Topic: How do you make a "print" button in javascript?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Dec 05, 2008, 09:26:08 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.995
Total Topics: 7.685
Total Members: 4.470
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: srinivasarao

25 Guests, 5 Users online :

10 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.