[Javascript] Printing Frames question . . .
LGO ô¿ô
Le_Geefted_One at ix.netcom.com
Wed Jun 9 18:48:43 CDT 2004
Chris T wrote:
>
> 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.
Hi Chris,
Thanks for replying, but I'm not certain I explained things very well. I've done
some more experimenting with this script and this is where I'm at now . . .
It's a two frame frameset with a header frame and a main frame, and in fact,
those are the frame names; "header" and "main." I want a link in the header
frame document to print the main frame document. All of the script I sent
earlier was in the header document, as is what's below. The following is exactly
as it appears in my page . . .
In the header document I put in the <head> . . . </head> section;
<script>
function framePrint(){
parent.main.focus();
parent.main.print();
}
</script>
In the body of the header document I have;
<a href="javascript:framePrint('main');">CLICK TO PRINT</a>
When I run this I get the following the error message:
'parent.main' is null or not an object
I tried your suggestion of putting alert(main) after the declaration statement,
and I get the error message
'main' is not defined
error message.
I feel totally clueless as I'm sure it's some syntax error that I should now.
Any guidance you can offer will be appreciated.
Many thanks!
More information about the Javascript
mailing list