Forum
Notifications
Clear all
Topic starter
You can use JavaScript to automatically open print dialogue box so that users can print the page. Although most users know they can do something like File > Print, a Print this page option can be nice, and may even encourage users to print the page. Also, this code can be triggered automatically upon loading a printer friendly version.
The following code creates a hyperlink and uses the JavaScript print function to print the current page:
<a href=""JavaScript:window.print();">Print" this page</a>
To automatically open the print dialogue box, copy and paste the following code after the </body> tag:
<script type="text/javascript">
<!--
window.print();
//-->
</script>
Posted : 16/03/2011 12:37 am