httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blain Sadler <blain.sad...@tradedesksoftware.com>
Subject Re: [users@httpd] Javascript File location
Date Tue, 03 Aug 2004 18:32:05 GMT
Walter,

src="Qscript.js"  is a relative path, so it will always look for 
Qscript.js in the current directory of whatever page uses it.  You could 
create a scripts directory or alias, and use src="/scripts/Qscript.js" 
which would be found no matter what the location of the page that loaded 
it was.

Cheers,

Blain

Walter Ogston wrote:

> Dear friends,
>
> Please excuse me for asking a newbie question.  I am running Apache 
> 2.0.49 under Windows XP, testing with IE 6.0 browser.
>
> I have written an apache module that serves up an html document that 
> uses Javascript.  Here is the top of a typical html doc:
>
> <HTML>
> <HEAD>
> <TITLE>Survey Concepts:  BMH - Golden Triangle 06/03</TITLE>
> <SCRIPT LANGUAGE="JavaScript" SRC="Qscript.js"></SCRIPT>
> <SCRIPT LANGUAGE="JavaScript">
> function setText(aId, aValue) {
> aId.value = aValue;
> }
> </SCRIPT>
> </HEAD>
>
> <BODY onLoad="countQuestions(document.forms[0]);  vAnswersRequired = 1">
> ... lots of stuff here
> </BODY>
> </HTML>
>
> Qscript.js contains definitions for countQuestions() etc.  When I save 
> a copy of this doc in the htdocs folder, and also Qscript.js in the 
> same folder, the client-side scripts work correctly.
>
> My question is, where do I locate the file Qscript.js so that it can 
> be found by relative address when the calling document is served by a 
> module?  When I load the form generated by the module into the web 
> browser, I get an error message like "line 2 character 1 Syntax 
> error", which I interpret to mean that the function countQuestions() 
> cannot be found.  In other words, what is the base for relative 
> addressing when referring to a src= file from a dynamically generated 
> document?
>
> I have tried putting QScript.js in the folders httpd, httpd\scripts 
> and \modules, so far without success.
>
> TIA
>
> Walter
>
> /*----------------
> C. Walter Ogston
> ogstoncw@charter.net              Kalamazoo, Michigan
> */
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>

-- 
Blain Sadler
Software Developer
TradeDesk Software Corporation
8 Diane Drive
Essex Junction, VT 05452-4008
phone: (802) 655-2777
e-mail: blain.sadler@tradedesksoftware.com




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message