View Full Version : How to make automatic opened print window?

01-08-2009, 10:46 AM
I have used code to publish article on website with link to print.

When there is clicked link it will open printer friendly page with link to print this page. I used code which works:

<a href="print.php?printable=true" onClick="window.print()" target="_blank">Print firendly page</a>

Article page has redirection to print friendly page:

<a href="print.php?printable=true" target="_blank">Print firendly page</a>

This works but I have to click on link. I need also option to open print window automatic as soon there is clicked on print link within article page but it should be printed print firendlyl page.

How to do it?

01-08-2009, 04:44 PM
On the page that is to be printed:

<script type="text/javascript">
window.onload = function{ window.print(); }