Chapter 20: Extending ColdFusion Pages with CFML Scripting
343
•
CFScript is case-insensitive.
•
All statements end in a semi-colon, and line breaks in your code are
insignificant.
•
In CFScript, assignments are statements, not expressions.
•
Some implicit objects are not available, such as Window and Document.
Note
CFScript is not directly exportable to JavaScript. Only a limited subset of
JavaScript can run inside CFScript.
Reserved words
In addition to the names of ColdFusion functions and words reserved by ColdFusion
expressions (such as NOT, AND, IS, and so on), the following words are reserved in
CFScript. Do not use these words as variables or identifiers in your scripting code:
•
for
•
while
•
do
•
if
•
else
•
switch
•
case
•
break
•
default
•
in
•
continue
Interaction of CFScript with CFML
You enclose CFScript regions inside <CFSCRIPT> and </CFSCRIPT> tags. No other
CFML tags are allowed inside a CFSCRIPT region.
A CFSCRIPT tag block must contain at least one CFScript statement, and comments
are not considered statements. If there are no statements, you should comment out
the entire CFSCRIPT block (including its enclosing <CFSCRIPT> and </CFSCRIPT>
blocks) with CFML comment tags.
You can read and write ColdFusion variables inside CFScript, as shown in this
example:
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...