You are here: irt.org | FAQ | JavaScript | Print | Q1525 [ previous next ]
First set the focus to the frame you wish to print, and in the same commandline give the window.print() command:
<frameset rows="30%,*"> <frame name="controll" scr="control.htm> <frame name="mainpage" scr="main.htm> </frameset>
In the control.htm:
<form><input type="button" value="Print" onClick="parent.mainpage.focus();window.print()"></form>
Submitted by Gerrit Krijgsman
To print Frame B from Frame A, try:
<a href="javascript:printit()">Print</a>
Add the following code somewhere in your source of Frame A:
<script language="JavaScript"><!-- function printit() { parent.frameB.focus(); parent.frameB.print(); } //--></script>
Submitted by Sébastien Anselment