Created
January 9, 2013 11:16
-
-
Save 2dpi/4492396 to your computer and use it in GitHub Desktop.
JAVASCRIPT: print web page button/link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JAVASCRIPT - PRINT PAGE | |
// ======================= | |
// http://javascript.about.com/library/blprint.htm | |
// Add a link to locally hosted file | |
// <link rel=alternate media=print href="printversion.pdf"> | |
window.print();return false; | |
// HTML link | |
// <a href="#" onclick="window.print();return false;">Print This Page</a> | |
// FORM button | |
// <input type="button" value="Print this page" onclick="window.print();return false;" /> | |
// NB! Has delay between clicks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment