473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Javascript Print Command

Hello,

I know this should be kind of easy, but I am very unfamiliar with
Javascript.

What I am looking to do is have an image (coupon) that when clicked on,
it either prompts for printing only that image, or pops up a window and
automatically after loading the image in the new window, brings up the
print dialog box. What would you suggest is the best way to do this?

Thank you in advance,

Brian

Feb 17 '06 #1
2 6821
VK

Ko*****@gmail.com wrote:
Hello,
Hi,
What I am looking to do is have an image (coupon) that when clicked on,
it either prompts for printing only that image,
Not doable: print() method applies to the entire window or to the
current frame (if frameset), and it always shows print dialog first (a
security mesure).
or pops up a window and
automatically after loading the image in the new window, brings up the
print dialog box. What would you suggest is the best way to do this?


Taking into account what I said before, the only visible option is to
make each picture linked to popup function, and each popup window
having <body onload="window.print()">

Also note that many visitors will probably have popup blockers
activated.

If you want to run a discount coupons business, I would suggest to use
hidden iframe to rewrite the content on each image click and
myIFrame.print() then. Very old but still the best way IMHO.

Feb 17 '06 #2
Thank you very much, that is exactly what I was looking for. I only
have a need for like one or two coupons on the site, so it is a basic
operation.

Feb 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tommo | last post by:
Hello All, I am a still learning so be easy on me. I am trying to get some code to work that is using JS and Perl/CGI, I am using AS Perl and an Apache Server on XP as the webserver. Can anyone...
4
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...
3
by: Jennie | last post by:
I am looking for a way to make the web page have a formfeed so the info from that spot will go to the top of the next printed page when I file>print the web page. I want it not to break on the...
6
by: Questman | last post by:
Does anyone have code they could share that would implement a telnet session in a browser using Javascript? I've seen it done once, but they did not have code available. This would be integral to...
1
by: bbcrock | last post by:
Is it possible to send attributes into this function to change the print preferences from Portrait to Landscape with IE 6.0 set as the standard browser? Right now I'm using ...
47
by: SOLAV | last post by:
This is the only working way to completely hide your JavaScript code from the client just like PHP or ASP code. Here we'll need the help of PHP. Here is the code: index.php...
1
by: greatvishal | last post by:
Hi, I have a page where I am trying to render a pdf file using response.contenttype = "application/pdf". when the page has rendered, I need to launch a javascript command to launch the window's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.