Here's a little tip for using a .cfm file for dynamic JavaScript generation.

Need to use JavaScript, but not sure what the JS will actually look like until you build it... but don't want to show the JavaScript on the webpage? I am using Spry for some Ajax style selects, but I need to control the XML on the fly.

Try something like this:

view plain print about
1<cfparam name="url.year" default="#year(Now)#">
2...
3<script type="text/javascript" src="/ClientIncludes/DynamicCFJS.cfm?year=#url.year#"></script>

You could then have in your DynanicCFJS.cfm something like this:

view plain print about
1<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
2<cfoutput>
3var dsYears = new Spry.Data.XMLDataSet("/index.cfm?event=buildYearList&year=#url.year#", "carlineYears/year", { useCache: true });
4</cfoutput>

Of course, similar techniques will work in any web language. Tailor to the web language of your choice.