
KevinR
Veteran

Jul 4, 2008, 9:45 PM
Post #8 of 8
(945 views)
|
|
Re: [babyboy] Add Javascript files and Javascript code using CGI.pm
[In reply to]
|
Can't Post
|
|
try this:
use CGI qw/:standard/; my $javascript = <<END; function checkRemove(element) { var obj = document.getElementById(element); if (obj) { obj.getParentNode().removeChild(obj); return true; } return false; } END my $srcfile = './wanker.js'; print header, start_html(-title=>"Wanker!", -script=>{-type=>"text/javascript", -src=>"$srcfile"}, -head=>script{-type=>"text/javascript"},$javascript, ); the -head tag allows for arbitary things to placed in the head section of the html document. It is discussed in the same section I referenced previously. -------------------------------------------------
(This post was edited by KevinR on Jul 4, 2008, 9:49 PM)
|