G
gmazujian
I have a problem. I would like to call a cgi program from javascript.
I have scanned the web. I have a cgi program. It works fine if I call
it by the url. However, when I call it from the javascript script it
appears to do nothing. It doesn't generate any error.
First, Here is my html with Javascript.
<script type="text/javascript" language="JavaScript"
src="/cgi-bin/cookie/script1.cgi">
</script>
Second, here is my cgi program.
#!/usr/local/bin/perl
# CGI program can do other stuff here.
print "Content-type: text/html\n\n";
print "<!--\n";
print "var x;\n";
print "document.write('The number of visits is: ');";
print "//-->\n";
# end of program
It would be greatly appreciated if someone could tell me what is going
wrong with it. By the way, this is on a FreeBSD machine running Apache
1.3.3.
I have scanned the web. I have a cgi program. It works fine if I call
it by the url. However, when I call it from the javascript script it
appears to do nothing. It doesn't generate any error.
First, Here is my html with Javascript.
<script type="text/javascript" language="JavaScript"
src="/cgi-bin/cookie/script1.cgi">
</script>
Second, here is my cgi program.
#!/usr/local/bin/perl
# CGI program can do other stuff here.
print "Content-type: text/html\n\n";
print "<!--\n";
print "var x;\n";
print "document.write('The number of visits is: ');";
print "//-->\n";
# end of program
It would be greatly appreciated if someone could tell me what is going
wrong with it. By the way, this is on a FreeBSD machine running Apache
1.3.3.