Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Multiple script tags?

by peschkaj (Pilgrim)
on Oct 14, 2003 at 15:47 UTC ( [id://299153]=perlquestion: print w/replies, xml ) Need Help??

peschkaj has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to use the CGI module to generate multiple script tags in the <head> element of an HTML document?

My question in entirely aesthetic - I don't like having script tags wandering about my HTML.

Thanks,
jeremiah

Replies are listed 'Best First'.
Re: Multiple script tags?
by duct_tape (Hermit) on Oct 14, 2003 at 15:57 UTC

    Pass -script an array reference. Something like this? I assume this does what you want it to do.

    print start_html(-script => [ 'js1', 'js2' ]);
    Hope that helps.
    Brad

      Thanks, this seems to do the trick:

      print $q->start_html( -script=>[ { 'language'=>"javascript", 'type'=>"text/javascript", 'src'=>"png.js" }, { 'language'=>"javascript", 'type'=>"text/javascript", 'src'=>"mailForm.js" } ] );
        Just a little TIMTOWTDI on a Tuesday afternoon:
        print $q->start_html( -script => [ map { language => 'javascript', type => 'text/javascript', src => $_, }, qw(png.js mailForm.js) ] );

        jeffa

        L-LL-L--L-LL-L--L-LL-L--
        -R--R-RR-R--R-RR-R--R-RR
        B--B--B--B--B--B--B--B--
        H---H---H---H---H---H---
        (the triplet paradiddle with high-hat)
        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://299153]
Approved by jdtoronto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-24 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found