Well the thing is that the js variables need to be part of the DOM. You can
your cf vars in both of those functions and then just reference them in your
display templates when you set up the js vars. That would also give you a
chance to override them on a per page basis.

On Thu, Oct 28, 2010 at 3:39 PM, Rick Faircloth <[email protected]>wrote:

>
> Question:
>
> What about using onApplicationStart in application.cfc to set
> global cf to js variables for the site
>
> and
>
> using onRequestStart in application.cfc to set specific page
> cf to js variables for a page.
>
> Gives me only one place to change variables.
>
> Any drawbacks to that approach?
>
>
>
> -----Original Message-----
> From: Michael Grant [mailto:[email protected]]
> Sent: Thursday, October 28, 2010 2:30 PM
> To: cf-talk
> Subject: Re: Question about using javascript in .cfm files...
>
>
> No, more like this
>
> <cfset jsVar = "myCFVar" />
>
> <cfoutput>
> <script>
>
> var jsVar = '#jsVar#';
>
> </script>
> </cfoutput>
>
> <script src="srcJS.js"></script>
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338657
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to