RE: Help Required [HOW DO I INCLUDE MY JAVA SCRIPT files in my P ERL SCRIPT FILE]
[email protected] ("Moon, John") Wed, 28 May 2003 10:18:40 -0400
| Newsgroups | perl.javascript |
|---|---|
| Message-ID | <870A2C59C4C884418DD7EB4B9306124F0323238A@dmssem01.dms.state.fl.us> |
This example in written into the body...
# Ship to checkbox
if ($Cust_Data{ship_to_key} != "") {
print <<SCRIPT2B;
document.customer_form.ship_to_diff.checked=true;
document.customer_form.ship_to_init.value='on';
SCRIPT2B
}
This is "included" for form execution ...
my $cript=<<ENDSCRIPT
function test {
}
ENDSCRIPT
or
my $cript = &IncludeScript('test.js'); # add "canned" script from a library
sub IncludeScript {
# use dienice;
my ($cript)=@_;
open SCRIPT_SRC, "Library/JavaScripts/$cript"
or dienice('Open($cript) - Failed');
my $JSCRIPT='';
while (<SCRIPT_SRC>) {
$JSCRIPT .= $_;
}
close SCRIPT_SRC;
return $JSCRIPT;
}
1;
print $q->start_html(-title=>$title,
-script=>$cript);
hope this helps
jwm
-----Original Message-----
From: sasi pillutla [mailto:[email protected]]
Sent: May 28, 2003 09:38
To: [email protected]
Subject: Help Required [HOW DO I INCLUDE MY JAVA SCRIPT files in my PERL
SCRIPT FILE]
how do i include JS files in my ".pl" files
thanks in advance
ur
sasi
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com