values = { dsn: '<cfoutput>#application.dsn#</cfoutput>' } 

So lemme get this straight... you are going to put your dsn into a js var?
You might as well just output it on the page for all to see ;)

You can change extension or output the cfm into a dummy container and then have 
jquery pick it up after it loads. If you change extension and it loads before 
document ready and you have code dependent on that then you are gunna be SOL. 
Now a good js programmer might get around this but if you are asking then you 
ain't one of them! ;)

However the best way would probably be to use jquery to "load" the cfm code 
after it loads.

say I have a cfm page called data.cfm that has a table that has user info and a 
cfc call. I want this to load after dom sometimes because say I 
add/update/delete a user without leaving page but want the table to update.. I 
just run the ajax call and then reload the data,cfm page to fill it back in 
like so:

$(document).ready(function() {
    $("#submit").click(addPhoto);
    $('#dataresponse').hide();
    $('#load').hide();
    $(".submitIt").hide();
    $("#galleryTable").load("data.cfm");





>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:326129
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to