[thelist] JavaScript with Apache Server

Seb Barre sebastien at oven.com
Tue Dec 19 17:40:04 CST 2000

At 03:43 PM 12/19/2000 -0600, you wrote:
>A friend of mine is having a problem and I thought someone might be able 
>to help.
>Here's the problem:
>Do you by any chance know anything about JavaScript
>and the Apache Web Server.  I am trying to create a
>shared code file in JS on the server
>There are several funcitons I have written that I would like to
>use in several web pages.  ie:  is_num, is_empty...
>These functions will determine if a string is either
>empty or if it contains only numbers.  I am using
>these to help in form validations.  Rather than have
>copies in each html file I would like to have one
>'utils.js' file on the server.
>This file would be included by the following:
><script src="$PATH/utils.js"></script>

Javascript is client-side scripting, not server-side, so the file can't be 
located in your CGI-BIN directory.  Put it somewhere in your regular static 
document path and reference that URL instead.  If you load a file from the 
cgi directory, the webserver will try to execute it server side and return 
the output to the browser (which will fail in this case).


--- -- -
Seb Barre - seb at oven.com
OVEN Digital Toronto
Work: 416-595-9750 x 222
Mobile: 416-254-5078

More information about the thelist mailing list