Question : how to print a web page

Hello Experts,
On my website i 'd like put "print this page" img button to let visitors to see the page first then to print the page they are currently seeing.
I created print friendly CSS. I use onclick"window.print()" . it does the job, (without showing the page in a new window)
 
however i would like to present the print friendly page in a NEW window then user clicks "print button" then goes to printer

could you provide some codes

thanks in advance

Answer : how to print a web page

Sorry, I really made a few typos.


if (location.search.indexOf('printfriendly==-1') ){
should have been


if (location.search.indexOf('printfriendly')==-1){

Have a look here:

http://www.plungjan.name/test/doc_write_css.html
http://www.plungjan.name/test/doc_write_css.html?printfriendly

Random Solutions  
 
programming4us programming4us