Hi, Michael... No, I'm not trying to output anything to the browser, just establish the variables, in this case the JS global variables for use throughout the site.
I establish all the CF variables in the application.cfc and was trying to see if I could accomplish the same thing with the JS variables. But trying to process any JS within a .cfc always just returns the JS script, itself. It seems like JS can't be processed in a .cfc, or perhaps I'm missing something. I've been cfincluding a file that processes the JS variables, such as those below, as part of the .cfm pages, but was just trying to see if I could do it once in the application.cfc in the onRequest section. Rick -----Original Message----- From: Michael Grant [mailto:[email protected]] Sent: Thursday, September 15, 2011 11:27 AM To: cf-talk Subject: Re: Any way to process this within onRequest in Application.cfc? What exactly do you mean by processed? Do you mean outputted to the browser? Wouldn't the code you show end up being before the doctype declaration of an html page? On Thu, Sep 15, 2011 at 11:21 AM, Rick Faircloth <[email protected]>wrote: > > <!--- [ js version of cf variables ] ---> > > <cfset js_sitename = application.sitename /> > <cfset js_website = application.website /> > <cfset js_site_manager_dsn = application.site_manager_dsn /> > <cfset js_client_dsn = application.client_dsn /> > > <cfoutput> > > <script type="text/javascript"> > > var js_sitename = '#js_sitename#'; > var js_website = '#js_website#'; > var js_site_manager_dsn = '#js_site_manager_dsn#'; > var js_client_dsn = '#js_client_dsn#'; > > </script> > > </cfoutput> > > > It seems that no matter how I try to do it, either putting js directly > into an application.cfc or either using a cfinclude in an > onRequest function, the js can't be processed along with the other > code in the application.cfc. > > I'm trying to locate all variables for a site in one place (part of > an MSOC design. > > Rick > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:347485 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

