Now I know why you make the big bucks, James! :o)

Thanks...

-----Original Message-----
From: James Holmes [mailto:[email protected]] 
Sent: Tuesday, September 08, 2009 9:47 PM
To: cf-talk
Subject: Re: How to handle CF variables in JS (jQuery) external files...


Use the .cfm extension instead of .js.

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



2009/9/9 Rick Faircloth <[email protected]>:
>
> Hi, all.
>
>
>
> I've decided to try to use some external .js files for a login routine for
a
> site management area
>
> instead of repeating the jQuery code on every page checking for login
status
> and running ajax
>
> login routines.
>
>
>
> I just realized, however, that when I put my jQuery code into an external
> .js file, that CF will no longer
>
> process the CF variables I use in the jQuery code, typically for the
> #application.dsn# variable, as in:
>
>
>
> $(document).ready(function() {
>
>
>
> values = { dsn: '<cfoutput>#application.dsn#</cfoutput>' }
>
>
>
> When that code is part of a .cfm file, of course the #application.dsn# is
> processed,
>
> but in the external .js file, it's not.
>
>
>
> Other than hard-coding the dsn name into the value for the js, what
> alternative is there
>
> for this situation?
>
>
>
> Thanks for any suggestions.
>
>
>
> Rick
>
>
>
>
----------------------------------------------------------------------------
> ---------------------------------------
>
> "Those who hammer their guns into plows will plow for those who do not."
 -
> Thomas Jefferson
>
>
>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:326128
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