JavaScript Print Version - prints current page.

You can create a page that automatically makes the Windows print dialogue box appear with a full version of the HTML page you want to print.

To create a "Print this page":

  1. Copy and paste the following code in between the <HEAD> and </HEAD> tags of the document that you want printed:



  2. Add the following to your <BODY> tag: onload="printpage()"

So, your body tag should look something like this:

<body bgcolor="#FFFFFF" onload="printpage()">

Why create a print version?
You may find that you have an article that spans many HTML pages. You may have done this because "it's not user friendly to make users scroll". The reality of it is, it's not user friendly to make people click on multiple links, simply to finish the story! Many users would rather print "the whole thing", then read it later.This is easily achieved using JavaScript to create a one-page "print version".

The "create print version" automatically automatically opens the print dialogue box. If you, as a programmer, coincide this with a "Print this tutorial" type message, users will only need to click on the "Print this tutorial" link and the Windows' print dialogue box will automatically appear, along with the Printer friendly version.