There's more than one way to do things | |
PerlMonks |
Javascripts in HTML headerby chriso (Sexton) |
on Dec 27, 2001 at 18:14 UTC ( [id://134604]=perlquestion: print w/replies, xml ) | Need Help?? |
chriso has asked for the wisdom of the Perl Monks concerning the following question:
I want to run a JavaScript function located in the header. According to the documentation in CGI.pm, start_html is a "Canned HTML header" which can contain the following parameters (I've left other parameters out):
# $title -> (optional) The title for this HTML document (-title) # $script -> (option) Javascript code (-script) # $head -> (optional) any other elements you'd like to incorporate into the <HEAD> tag (a scalar or array ref) # @other -> (optional) any other named parameters you'd like to incorporate into the <BODY> tag. Here is the JavaScript I want to run along with the perl script I've used: The CGI.pm documentation is not clear on putting a function in the <HEAD> section. It says: $head -> (optional) any other elements you'd like to incorporate into the <HEAD> tag (a scalar or array ref) but it doesn't explain how to do this. I want a new window to open when the user loads this page. Can anyone provide some guidance and correct my script? Many Thanks. Chris
Back to
Seekers of Perl Wisdom
|
|