| You are here: Home > Scripts > Javascript Print webpage script |
| ||||||||||||||||||
|
Back to ScriptsTutorial, calling Print in HTMLCreating a simple Print button or link. This is a client side request, this is a non-standard call and works only in IE 5 (and firefox) and above. However the flip side is that 97% of the browser market is using Internet Explorer or Firefox. The method call is very simple to execute <a href="javascript:window.print()">Print this page</a> Try it! Print this page Print child Window If you are generating the content of the popup window on the fly (document.write) make sure to close the document window before printing, otherwise the print functionality will not work. newWindow.document.close(); Hiding HTML elements before printing Microsoft has an "onbeforeprint" and "onafterprint" events that you can listen on to hide sections of your screen, commonly layered using DIV's. And when the printing is done, to bring back those layers. IE browser market (eLouai stats) 01 Mar 2004 - 19 Mar 2004, number of visitors
UPDATE: Browser Market Share for eLouai.com 01 Mar 2006 - 19 Mar 2006, number of visitors
references: MSDN: print() Method Faqts knowledge base: printing in a child window |
||||||||||||||||||||||||||||||||||||||||||||||||
|
contact us: elouai@gmail.com ©2003-2008 eLouai.com, All rights reserved |