28, May 2012

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

 
Webdigity webmaster forums
[ 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
Instabuck - The easy way to sell digital products online

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



« on: Aug 31, 2005, 02: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, 02: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, 03: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: 5799
46391 credits
Members referred : 3



« Reply #3 on: Aug 31, 2005, 03: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 or twitter

Last blog : Butterfly Marketing 2.0
I wish I was an Oscar winner
**
Posts: 86
247 credits
Members referred : 0



« Reply #4 on: Aug 31, 2005, 04: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, 07: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....

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?
May 28, 2012, 10:34:08 pm





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!






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