Javascript Print Command

Discussion in 'Javascript' started by Kosarko@gmail.com, Feb 17, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. VK Guest

    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.
     
    VK, Feb 17, 2006
    #2
    1. Advertising

  3. Guest

    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, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bad_Kid
    Replies:
    3
    Views:
    3,949
    Shawn H. Mesiatowsky
    Apr 7, 2005
  2. keto
    Replies:
    0
    Views:
    957
  3. tigeressal

    html javascript print command

    tigeressal, Apr 12, 2008, in forum: HTML
    Replies:
    14
    Views:
    7,371
    Toby A Inkster
    Apr 29, 2008
  4. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    358
    David Cournapeau
    Dec 30, 2008
  5. prakash
    Replies:
    2
    Views:
    595
    prakash
    Apr 11, 2005
Loading...

Share This Page