Hi all,
I have a perl function that I would like to call from inside a JavaScript
function in a Web page. I want to pass it a string param and return an
integer. The function is shown here is fabricated just to reduce the example
to the bare minimum.
#!/usr/bin/perl
sub SomeFunction {
$StrVar = $_[0];
#Some test on the param passed
if ($StrVar eq 'This is a test')
return 1;
else
return 0;
}
What I would like to do is to call my function from inside some JavaScript
i.e.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Ok(SomeString){
if (SomeFunction(SomeString))
return true;
else
return false;
}
//-->
</SCRIPT>
///////////////
I would appreciate it if you can tell me how I can ensure the Perl function
is available in the JavaScript and if there is anything I need to do to
ensure the parameter is passed correctly.
In JavaScript I can save the script on the server and call in the functions
into the page with the following
<SCRIPT SRC="Functions.js" LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Ok(SomeString){
if (SomeFunctionInJs(SomeString)) //Some test
return true;
else
return false;
}
//-->
</SCRIPT>
////////////////////////////////////////////////////////////////////////////
Best regards
Mike Craig
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]