×

Loading...

How to print a frame by issuing command in another frame? Merci Beaucoup...

I have a JavaScript question. Thanks for telling me how-to.

Let me examplify my question. I have a .HTML page, which contains two frames.
Frame 1 contains some meaningful contents.
Frame 2 contains a hyperlink under "Print",
with onClick attribute related to a JavaScript function. My purpose is to print the contents of Frame 1. I don't have luck here---Each time I click my link, I print out Frame2.

Enclosed is the skeleton code for Frame 2.

<html>
<title>FRAME 2</title>
<SCRIPT LANGAUGE="JavaSCRIPT">
function printFrame1(){
parent.Frame1.print();
}
</SCRIPT>
</head>
<body>

<A href='#' onclick="printFrame1()" > Print</a>
</body>
</html>
Report