Log in

View Full Version : Print Button On Web Page



JBottero
10-01-2007, 12:44 AM
I'd like something like this:

http://www.dynamicdrive.com/dynamicindex9/other1.htm

But instead of a button, it needs to be a text link.

Any ideas?

thetestingsite
10-01-2007, 01:01 AM
If you want to use that script, simply change this line:



document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');


to this:



document.write('<a href="#" onClick="printit(); return false;">Print The Page</a>');


Hope this helps.

JBottero
10-01-2007, 01:56 AM
I've also seen this:


<a href="javascript:window.print()">Print</a>

Which seems disturbingly simple. It seems to work, am I missing something?