[Javascript] Printing Frames question . . .

Chris T christ at saeweb.com
Wed Jun 9 13:14:57 CDT 2004


Object expected errors generally get arise when it can't find the function,
but you say this is all in the same BODY tag. Odd.

Try putting:

alert(whichFrame)

as the first line after your declaration.  If you see the alert, then you
know it's one of the following lines that are erroring out. If you don't,
then you know it can't find the script. Perhaps you have a script inside of
another script somehow?

Chris Tifer
http://emailajoke.com


----- Original Message ----- 
From: "LGO ô¿ô" <Le_Geefted_One at ix.netcom.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Wednesday, June 09, 2004 1:53 PM
Subject: [Javascript] Printing Frames question . . .


> 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
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list