PDA

View Full Version : Script for print?


fat_dog
07-13-2002, 02:55 PM
Hi guys !

Whats the script for linking to print?

Any help is great :)

redhead
07-13-2002, 03:13 PM
try this:

<script language="JavaScript">
<!--
if (window.print)
document.writeln('<form><input type="button" value="Print" onClick="window.print()"><\/form>');
//-->
</script>

it displays a button that the user can click, if their browser doesnt support it, it doesnt display.

or if you want a text link, try this:

<script language="JavaScript">
<!--
if (window.print)
document.writeln('<a href="#" onclick="window.print(); return false">Print this page</a>');
//-->
</script>

happy coding :thumbsup: