[Javascript] Printing Frames question . . .
Chris T
christ at saeweb.com
Thu Jun 10 08:10:50 CDT 2004
> In the header document I put in the <head> . . . </head> section;
>
> <script>
> function framePrint(){
> parent.main.focus();
> parent.main.print();
> }
> </script>
> <a href="javascript:framePrint('main');">CLICK TO PRINT</a>
> I tried your suggestion of putting alert(main) after the declaration
statement,
> and I get the error message
>
> 'main' is not defined
>
> error message.
Well, alert(main) wouldn't show anything as main isn't defined in your
current incarnation of your script. In the previous version, you had a
paramter being passed into the function (wasn't 'main', but was something
else - can't quite remember what) which is what I was having you alert. In
this version, you're passing your parameter, but your function doesn't
expect one. You could probably use the parameters collection to access it,
but I digress... That could be a pretty long-winded discussion.
I see your problem has been solved in the other e-mail, just wanted to point
out why you ended up getting an error for future reference.
Chris Tifer
More information about the Javascript
mailing list