logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Problem with Apache, HTML::Template, and Javascript
Author
memnoch



Joined: 01 Jan 2008
Posts: 8

PostPosted: Thu 20 Mar '08 21:56    Post subject: Problem with Apache, HTML::Template, and Javascript Reply with quote

Greetings Apache Gurus!

I have a Perl CGI application written with CGI::Application and HTML::Template. If I embed Javascript in one of the HTML templates with:

Code:
<script type="text/javascript"><TMPL_VAR NAME='jscript'></script>


all is well. But if I try to load the same Javascript code from an external file with:

Code:
<script language="Javascript" type="text/javascript" src="validate.js"></script>


the javascript doesn't work. In the Apache error log I see:

Code:
[Thu Mar 20 15:33:34 2008] [error] [client 127.0.0.1] C:/Apache2/cgi-bin/liaison/validate.js is not executable; ensure interpreted scripts have "#!" first line, referer: http://www.mylocalhost.com/cgi-bin/liaison/liaison.cgi
[Thu Mar 20 15:33:34 2008] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: C:/Apache2/cgi-bin/liaison/validate.js, referer: http://www.mylocalhost.com/cgi-bin/liaison/liaison.cgi


Does anyone know how to resolve the above?

Thanks,
memnoch
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Mon 07 Apr '08 20:55    Post subject: Reply with quote

Quote:

Bad file descriptor


You have to make sure that perl also parses .js extensions and not only .cgi files. (That is what I think, no for sure) or rename it to something like file.js.cgi (some browsers don't like that (send the a header canhelp you))


Mario
Back to top


Reply to topic   Topic: Problem with Apache, HTML::Template, and Javascript View previous topic :: View next topic
Post new topic   Forum Index -> Apache