CodeAve.com CodeAve.com - JavaScript - Document Info
ASP
JavaScript
·Document Info
·Forms
·Images
·Miscellaneous
·Navigation
·Script Writers
·Contents
·What's New?
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Print Current Page
Although JavaScript can't implicitly tell the browser to print the current page, it can open the print dialog box. This is the same action as clicking file and print from the toolbar or clicking the print button in the toolbar where the user will need to confirm the print command before the page will actually print. The following example will demonstrate this action from a hyperlink and a form button.
View the Output
Text View
Print View
Mail this Link
Download the Code

<html>
<title>CodeAve.com (JavaScript: Print This Page)</title>
<body bgcolor="#FFFFFF">

<form>
<input type="button" value="Print" Onclick="print()" ;>
</form>

<a href="javascript:print()">Print</a>

</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
Maps: Map Script Writers | Bing Maps | Google Maps
Privacy Statement

CodeAve.com is hosted by MyHosting.com
Donate Food Online with a Mouse Click at TheHungerSite.com
Donate Land Online with a Mouse Click at TheRainForestSite.com
© 1999 - 2010 CodeAve.com
All Rights Reserved