Dhivya Arasappan/O/VCU wrote:
> Hi everyone,
>
>
>
> I've been trying to put a button in my perl-cgi program which when
> clicked calls a javascript function.
>
>
>
> I need to send a previously initialized perl variable to the javascript
> function as an argument. But, when I try to pass the parameter to the
> jsp function, the function is not called properly.
>
>
>
> Here's a snippet of my code:
>
>
>
> $testvar = 'www.google.com';
>
> print("<input type=button value = 'callsite'
> onclick='popwindow($testvar);'>");
>
Looks like you need to add quotes to the window URL, like so:
$testvar = '"www.google.com"';
print("<input type=button value = 'callsite'
onclick='popwindow($testvar);'>");
- Eric
>
>
> The jsp function is as follows:
>
>
> function popwindow(v){
>
> newwindow=window.open(url,'test','height=400,width=200');
> if(window.focus){newwindow.focus()}
> }
>
>
>
> So, how do I pass a perl variable into a jsp function?
>
>
>
> Any help would be appreciated.
>
>
>
> thanks
>
> dhivya arasappan
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Perl-Win32-Web mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Web mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs