Although there are several really big advantages to an external 
'javascript' file being a static file, who said that your external file 
must end with .js? You can put a .cfm file in the src attribute of a 
script tag, serving a dynamic document through. Just make sure that the 
generated JavaScript is valid, and use the cfcontent tag to tell the 
browser that it's a javascript file.

Steve "Cutter" Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer

Co-Author of "Learning Ext JS"
http://www.packtpub.com/learning-ext-js/book
_____________________________
http://blog.cutterscrossing.com


On 8/3/2009 1:52 PM, Asaf Peleg wrote:
> I'm looking for a way to attach an external javascript sheet that includes 
> dynamic coldfusion code.  Obviously, a ColdFusion file must end with the .cfm 
> extension to be processed by the server and as I have found out through 
> research an external javascript sheets needs to end with a .js extension.
>
> The reason I need to do this is because I have a javascript heavy page that 
> builds a separate dynamic javascript array for each user (for a user specific 
> chain-select).
>
> I came up with the idea of compiling all the javascript in a<cfsavecontent>  
> and then writing that output to a specific .js file but I quickly realized 
> this would lead to race conditions if two users accessed the page at the same 
> time.
>
> There must be an elegant solution to this. Can anyone give me some advice?
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325187
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to