By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,387 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,387 IT Pros & Developers. It's quick & easy.

Javascript Print Command

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.