So, although I have long missed my chance at cfsummit to argue this. I was
trying to use cfjavascript again today and I feel like this functionality
is needed.
My scenario today is that I am using an MVC framework.
I have a basic layout that includes the necessary jQuery & css. However,
since I want to use this layout with multiple views that's all it has. For
each view I may need some different javascript functionality. cfjavascript
is perfect for this since I can use the output attribute to put my
javascript wherever I want in the page. But the problem still remains that
I can't use cf variables within cfjavascript! Look at the code below and
tell me if what I want to do seems so unreasonable.
<cfsilent >
<cfset page.login = buildURL('login.index') />
</cfsilent>
<cfjavascript output="HEAD">
$(document).ready(function(){
$('##login').click(function(){
window.location.href='#page.login#';
});
});
</cfjavascript>
Of course the above code does not work because cfjavascript does not
evaluate cf variables.Although I think NOT evaluating cf variables is a
great default for the tag i should have the option to force cfjavascript to
evaluate cf variables. Can we please add another boolean attribute like
evaluateVars (or whatever you want to call it)?
On Saturday, January 21, 2012 4:15:49 PM UTC-6, Aaron J. White wrote:
>
> Hey Guys,
>
> I messed with cfjavascript and stylesheet today and it seems really
> cool. There was one thing I couldn't do that I wish I could. It would
> be nice if cfjavascript (and maybe stylesheet) had an attribute that
> would make it double as a cfoutput when placing code inline. Does that
> seem reasonable? Sorry for the .net reference.
>
> Currently I am doing this:
> <cfoutput>
> <script type="text/javascript">
> var global = {
> 'ck':"#application.api.key#",
> 'imgBase':"#application.api.imageBase#",
> 'doStuff': false,
> };
> </script>
> </cfoutput>
>
> But I would prefer to do this:
> <cfjavascript runat="server">
> var global = {
> 'ck':"#application.api.key#",
> 'imgBase':"#application.api.imageBase#",
> 'doStuff': false,
> };
> </cfjavascript>
--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en
---
You received this message because you are subscribed to the Google Groups "Open
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.