Reputation: 1139
I would like to place some ColdFusion code into a javascript variable. Please could someone advise how this can be done.
The ColdFushion code is as follows:
#LabelOverride::get('person')#
Upvotes: 0
Views: 99
Reputation: 1295
A literal answer to your question would be something like:
<script>
var myJsVariable = '#EncodeForJavascript(LabelOverride::get("person"))#';
</script>
But if you're asking this question, I think there's a chance it's not going to behave quite how you might be hoping.
Upvotes: 4