cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cocoon User <coc...@eng.gr>
Subject Re: Include external javascript file
Date Sat, 01 Jun 2002 08:38:06 GMT

U have to edit your sitemap file
so cocoon know how to handle .js files

On Tue, 28 May 2002, Naquin, Beth wrote:

> A cocoon newbie question:
>
> I am trying to include a javascript function from an external .js file into
> my xsl stylesheet.
>
> I have the following in the xsl stylesheet:
>
> <head>
> ...
> <script  src="cold_reverse_script.js" language="javascript" ></script>
>
> </head>
>
> The file cold_reverse_script.js is in the same directory as the xsl
> stylesheet & contains javascript code for a single function:
>
> ----------------------------------------------------------------------------
> -------------
> function cold_reverse_search_criteria() {
>
> javascript code .....
>
> 		}
> ----------------------------------------------------------------------------
> ------
>
> I have this entry in my sitemap:
> <map:match pattern="**.js">
>     <map:read src="{1}.js" mime-type="text/jscript"/>
> </map:match>
>
> (I've also tried "text/javascript").
>
> However, this does not work.  I get "error on page" whenever I try to access
> the javascript function from the .js file.   When I look at the source for
> the HTML page in the browser, it shows "<script
> src="cold_reverse_script.js" language="javascript" ></script>" just as I've
> written it in the xsl file, but does not show the code that is in the .js
> file.
>
> If I put the javascript function code directly into the <script></script>
> tags, it works fine, but I'd like to use the external .js file.
>
> Any help would be greatly appreciated.
>
> Thanks,
>
> Beth Naquin
> SAGEM MORPHO Inc.
> 1145 Broadway Plaza STE 200
> Tacoma, WA 98402
>
> 253-597-8245
>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message