ColdFusion Tutorial

How to pass ColdFusion variables to Javascript

Just wrap the <cfoutput></cfoutput> tags around your entire Javascript and then use ColdFusion variables as you would normally.

Example:
<cfset var_name = "Outputting a variable from ColdFusion in JavaScript is easy. Just wrap the <cfoutput></cfoutput> tags around your entire Javascript and then use ColdFusion variables as you would normally.">
<cfoutput>
<script language="javascript" type="text/javascript">
<!--
document.write("#var_name#")
// -->
</script>
</cfoutput>


This will give the following output:
Outputting a variable from ColdFusion in JavaScript is easy. Just wrap the <cfoutput></cfoutput> tags around your entire Javascript and then use ColdFusion variables as you would normally.

ColdFusion Tutorial test

How to pass ColdFusion variables to Javascript

No test is available or implemented for this ColdFusion Tutorial.

No User Comments.

No User Comments, be the first one to write your comments?

Add your comments

Your Name*:
Your Email:
Site URL:
Site Name:
Comemt Title*:
Your Comment*:
Key Phrase*:
5cP
Your IP Address: 38.103.63.62
 

ScandicWeb is own by Scandic Systems LTD [UK] Company No. 5984000. All other trademarks and copyrights are the property of their respective holders.

[Home [Site Map [Privacy Statement [Site Feedback] [About ScandicWeb]


[ColdFusion [Flash [Search Engine Optimization [Graphics [Cascading Style Sheets (CSS) [JavaScript (JS) [Software]

Partner sites: ScandicSoft


Server time: 19. November 2008 Wednesday