[Javascript] Printing Frames question . . .

LGO ô¿ô Le_Geefted_One at ix.netcom.com
Wed Jun 9 12:53:27 CDT 2004


Hi,

Barely have any idea of what I'm doing with javascript . . .

Found the following script that allegedly prints a frame from a link in a
different and wanted to use it in a small project I'm doing (not on the 'net,
but it has html pages). The name of the frame whose contents I wish to print 
is the default name "main".

In the head of the page with the link . . .

<script>
function framePrint(whichFrame){
parent[whichFrame].focus();
parent[whichFrame].print();
}
</script>

In the Body of the same page . . . 

<a href="javascript:framePrint('main');">
Print This Page</a>

Whenever I try to run it, I get an error message that an "Object Expected."  
Not dealing with js every day puts me at a disadvantage (like anything else, 
use it or lose it) and I am at a loss as to what the error is.

Anyone have an idea (or a better script)? 

Many thanks for a reply,

LGO




More information about the Javascript mailing list