Leser: 3
4 Einträge, 1 Seite |
$cgi->start_html(-title=>'Foo', -style=>{src=>['../css/stylesheet1.css', '../css/stylesheet2.css']}, -script=>['../js/jquery.js', '../js/jquery.dimensions.js', '../js/jquery.hoverIntent.js', '../js/jquery.cluetip.js', '../js/meinscript.js']});
1 2 3 4 5 6 7 8 9
print CGI->start_html( -title=>'Foo', -style=>{src=>['../css/stylesheet1.css', '../css/stylesheet2.css' ]}, -script=>[ { -src => '../js/jquery.js'}, { -src => '../js/meinscript.js'}, ] );
QuoteThe <script> tag, has several attributes including "type" and src. The latter is particularly interesting, as it allows you to keep the JavaScript code in a file or CGI script rather than cluttering up each page with the source. To use these attributes pass a HASH reference in the -script parameter containing one or more of -type, -src, or -code:
...
A final feature allows you to incorporate multiple <script> sections into the header. Just pass the list of script sections as an array reference. this allows you to specify different source files for different dialects of JavaScript. Example:
4 Einträge, 1 Seite |