supress Printing 'print' link

B

Bob

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
 
R

rf

Bob said:
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.
 
D

David Dorward

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.
 
A

Andrew Bailey

David Dorward said:
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.


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

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top