...

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



toplisek
01-08-2009, 09: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?

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


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

Eric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum