Results 1 to 2 of 2
I want to call a javascript function from cgi c script.
I have this in my html header part,
printf("<script type=\"text/javascript\" src=\"/cgi-bin/test. js \">");
printf("</script>");
And in the body,
printf("<input ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-25-2013 #1Just Joined!
- Join Date
- Jun 2012
- Posts
- 9
Using javascript in CGI C script
I want to call a javascript function from cgi c script.
I have this in my html header part,
printf("<script type=\"text/javascript\" src=\"/cgi-bin/test.js\">");
printf("</script>");
And in the body,
printf("<input type=\"button\" id= \"Btn\" name=\"Button\" value=\"Set\" onclick=\"SetValue();\" size=\"4\">");
In test.js,
function SetValue()
{
alert('button clicked');
}
I don't get the alert message. However if i call alert directly in button onclick without javascript, i get the alert message. How do i get the javascript to work?
- 02-25-2013 #2
Javascript is normally executed on the client, while CGI is server-side. Are you sure you want to do this? If you're doing things server-side, surely you should be executing PHP or Perl scripts directly, not code embedded into your web page - which is for the client to use.
Linux user #126863 - see http://linuxcounter.net/


Reply With Quote
