RE: cgi-perl: embedding javascript in cgi-perl
by Steve Lloyd other posts by this author
Aug 14 2006 1:39PM messages near this date
view in the new Beta List Site
cgi-perl: embedding javascript in perl (mistake in first mail)
|
Fw: cgi-perl: embedding javascript in cgi-perl
You have to quote the variable in the html you print..
$testvar = 'www.google.com';
Print qq|<input type="button" value = "callsite"
onclick="popwindow('$testvar');"> |;
The jsp function is as follows:
function popwindow(v){
newwindow=window.open(url,'test','height=400,width=200');
if(window.focus){newwindow.focus()}
}
________________________________
From: perl-win32-admin-bounces@[...].com
[mailto:perl-win32-admin-bounces@[...].com] On Behalf Of
Dhivya Arasappan/O/VCU
Sent: Monday, August 14, 2006 2:32 PM
To: perl-win32-admin@[...].com
Subject: Fw: cgi-perl: embedding javascript in cgi-perl
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);'> ");
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
This email, and any files previous email messages included with it, may contain confidential
and/or privileged material. If you are not the intended recipient please contact the sender
and delete all copies.
|