supress Printing 'print' link

Discussion in 'HTML' started by Bob, Aug 3, 2007.

  1. Bob

    Bob Guest

    Hello folks,

    I havea link with a href of javascript:window.print()

    it works fine except that it prints the 'Print' link itself......

    anybody know how I can supress printing the link?

    Thanks,

    Bob
    Bob, Aug 3, 2007
    #1
    1. Advertising

  2. Bob

    rf Guest

    "Bob" <> wrote in message
    news:...
    > Hello folks,
    >
    > I havea link with a href of javascript:window.print()
    >
    > it works fine except that it prints the 'Print' link itself......
    >
    > anybody know how I can supress printing the link?


    Configure your browser to not print the 'Print' link.

    F1 will help.

    --
    Richard.
    rf, Aug 3, 2007
    #2
    1. Advertising

  3. On Aug 3, 2:26 pm, Bob <> wrote:

    > I havea link with a href of javascript:window.print()
    > it works fine except that it prints the 'Print' link itself......


    And except that it doesn't work when JavaScript isn't available and is
    a dead link instead.

    And except that it produces a new and unexpected UI control for
    something that the typical browser already presents the user with
    several ways of doing (File > Print, Ctrl+P, a print button in a
    toolbar, etc).

    It is pointless. It doesn't allow users to do anything they couldn't
    do before, breaks in some cases, and wastes screen space and
    bandwidth.

    > anybody know how I can supress printing the link?


    Best way - get rid of it. Otherwise set up a print media stylesheet.

    --
    David Dorward
    http://dorward.me.uk/
    http://blog.dorward.me.uk/
    David Dorward, Aug 3, 2007
    #3
  4. "David Dorward" <> wrote in message
    news:...
    > On Aug 3, 2:26 pm, Bob <> wrote:
    >
    >> I havea link with a href of javascript:window.print()
    >> it works fine except that it prints the 'Print' link itself......

    >
    > And except that it doesn't work when JavaScript isn't available and is
    > a dead link instead.
    >
    > And except that it produces a new and unexpected UI control for
    > something that the typical browser already presents the user with
    > several ways of doing (File > Print, Ctrl+P, a print button in a
    > toolbar, etc).
    >
    > It is pointless. It doesn't allow users to do anything they couldn't
    > do before, breaks in some cases, and wastes screen space and
    > bandwidth.
    >
    >> anybody know how I can supress printing the link?

    >
    > Best way - get rid of it. Otherwise set up a print media stylesheet.
    >
    > --
    > David Dorward
    > http://dorward.me.uk/
    > http://blog.dorward.me.uk/
    >


    Hi David,

    The HTML Police will probably moan but this is how I do it...

    <html>
    <head>
    <title>Test Page</title>
    </head>

    <script language="JavaScript" type="text/javascript">
    <!-- HIDE PRINT BUTTON
    function hideprintbutton(){
    printon.style.display='none';
    printoff.style.display='inline';
    }
    function showprintbutton(){
    printoff.style.display='none';
    printon.style.display='inline';
    }
    // - End of JavaScript - -->
    </script>

    <body onclick="showprintbutton()">

    <span id="printon" style="display: inline"><a href="javascript:
    hideprintbutton(); window.print()" title="Click here to PRINT this page"
    hidefocus><img src="../images/input/print_button.gif" width="80" height="80"
    border="0"></a></span>

    <span id="printoff" style="display: none"><img
    src="../images/input/print_button_mask.gif" width="80" height="80"
    title="Click anywhere to restore the PRINT button"></span>

    </body>
    </html>

    Hope this helps

    Andy
    Andrew Bailey, Aug 4, 2007
    #4
    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. JG
    Replies:
    3
    Views:
    4,003
    Scott Allen
    Oct 21, 2004
  2. Edwin Knoppert

    Supress error/warning of winapi in class?

    Edwin Knoppert, Dec 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    950
    Edwin Knoppert
    Dec 13, 2005
  3. Supress output

    , Feb 14, 2006, in forum: XML
    Replies:
    1
    Views:
    392
    Richard Tobin
    Feb 14, 2006
  4. roderik

    psycopg supress output

    roderik, Nov 15, 2004, in forum: Python
    Replies:
    1
    Views:
    266
    Michael Fuhr
    Nov 16, 2004
  5. Thomas Guettler

    supress creation of .pyc files

    Thomas Guettler, Feb 16, 2005, in forum: Python
    Replies:
    3
    Views:
    319
    =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=
    Feb 16, 2005
Loading...

Share This Page