The CFSCRIPT tag encloses a code segment containing CFScript.
<CFSCRIPT> CFScript code goes here </CFSCRIPT>
Use CFSCRIPT to perform processing in CFScript instead of CFML. Note the following regarding CFScript:
One use of CFSCRIPT is to wrap a series of assignment functions that would otherwise require CFSET statements.
| Note | If you use CFSCRIPT around the CFLOOP tag, any test expressions used as values to CFLOOP attributes are re-evaluated before each iteration of the loop, and if any part of the test expression is changed by code in the loop, it may affect the number of iterations that are executed by the loop. |
For more information on CFScript, see Developing Web Applications with ColdFusion.
<!--- This example shows the use of CFSCRIPT --->
<HTML>
<HEAD>
<TITLE>CFSCRIPT Example</TITLE>
</HEAD>
<BODY bgcolor=silver>
<H3>CFSCRIPT Example</H3>
<P>CFSCRIPT adds a simple scripting language to ColdFusion
for those developers who are more comfortable with JavaScript
or VBScript syntax.
<P>This simple example shows variable declaration and
manipulation.
<CFIF IsDefined("form.myValue")>
<CFIF IsNumeric(form.myValue)>
<CFSET x= form.myValue>
<CFSCRIPT>
y = x;
z = 2 * y;
StringVar = form.myString;
</CFSCRIPT>
<CFOUTPUT>
<P>twice #x# is #z#.
<P>Your string value was: <B><I>#StringVar#</I></B>
</CFOUTPUT>
<CFELSE>
...