User Guide
304 Chapter 2: ColdFusion Tags
cfscript
Description
Encloses a code block that contains cfscript statements.
Category
Application framework tags, Other tags
Syntax
<cfscript>
cfscript code here
</cfscript>
See also
cfinvoke, cfmodule, CreateObject,
Chapter 6, “Extending ColdFusion Pages with CFML
Scripting,” in Developing ColdFusion MX Applications
History
ColdFusion MX:
• Changed how to invoke component methods: this tag can now invoke component methods,
using the
createObject function
• Changed use of reserved words: you cannot use ColdFusion reserved words within this tag
• Added the try and catch statements.
Usage
Performs processing in CFScript. This tag uses ColdFusion functions, expressions, and operators.
You can read and write ColdFusion variables within this tag.
For a detailed description of the CFScript scripting language, including documentation of
CFScript statements and the CFScript equivalents of CFML tags, see Chapter 6, “Extending
ColdFusion Pages with CFML Scripting,” in Developing ColdFusion MX Applications
.
You can use this tag to enclose a series of assignment statements that would otherwise require
cfset statements.
Caution: If you code a cftry/cfcatch block within this tag using an exception’s Java class name, you
must provide the fully-qualified class name.
You cannot use some ColdFusion reserved words in this tag. You cannot put a user-defined
function whose name begins with any of these strings within this tag:
• cf
• cf_
• _cf
• coldfusion
• coldfusion_
• _coldfusion