Print

Adding the following to a button or link will print the page that it is in.
onClick="print()"


Which Frame?

If you select FILE | PRINT from the browser toolbar, the complete frameset as you see it on your screen will be printed on one page, (Unless the options are changed in the printer properties).
A more user friendly way would be to have a button or link within your frameset that will let your visitor print with ease.

A common frameset is one that has a navbar, a header, and a main frame where the pages are loaded, so it will be the main frame contents only that will be printed.

This can be done with the following script.

<script type="text/javascript">
<!--
function printFrame(){
if(window.print){
parent.framename.focus();
parent.framename.print()}
}
// -->
</script>

Where framename is the name of the frame containing the page to be printed.

The script does not necessarily have to go in the page that is going to be printed, it could go in the header or navbar and the button sited within a page or pages shown in the framename as a suggestion to print that page.

If the button or link is going to be in the same page as the script use:

onclick="printFrame()"

If the button or link is going to be in a different page to the script use:

onClick="parent.framename.printFrame()" Where framename is the name of the frame that the script is in.


When you print a page additional information is added to the top and bottom of the page relating to page address, page number etc.

On the File menu, click Page Setup.
In the Header and Footer boxes, specify the information to be printed by using the following variables.
Variables can be combined with text (for example, Page &p of &P).

To printType
Window title
Page address (URL)
Date in short format (as specified by Regional and Language Options in Control Panel)
Date in long format (as specified by Regional and Language Options in Control Panel)
Time in the format specified by Regional and Language Options in Control Panel
Time in 24-hour format
Current page number
Total number of pages
Right-aligned text (following &b)
Centered text (between &b&b)
A single ampersand
&w
&u
&d
&D
&t
&T
&p
&P
&b
&b&b
(&)