12
Compare the code that was returned to the browser with what you originally
created. Notice that the ColdFusion comments and CFML tags are processed, but
do not appear in the HTML file that's returned to the browser.
Original ColdFusion page
<HTML>
<HEAD>
<TITLE>Call Department</TITLE>
</HEAD>
<BODY>
<STRONG>Call Department</STRONG>
<!--- Set all variables --->
<CFSET Department="Sales">
<CFOUTPUT>
I'd like to talk to someone in
#Department#.
<!--- Display results --->
</CFOUTPUT>
</BODY>
</HTML>
Code Review
The application page that you just created contains both HTML and CFML. You used
the CFML tag CFSET to define a variable, Department, and set its value to be "Sales."
You then used the CFML tag CFOUTPUT to display text and the value of the variable.
Code
<!--- Set all variables --->
<CFSET Department="Sales">
<!--- Display results --->
<CFOUTPUT>
I'd like to talk to someone in
#Department#.
</CFOUTPUT>
Developing Web Applications with ColdFusion
HTML file returned by Web server
<HTML>
<HEAD>
<TITLE>Call Department</TITLE>
</HEAD>
<BODY>
<STRONG>Call Department</STRONG>
I'd like to talk to someone in
Sales.
</BODY>
</HTML>
Description
CFML comment, which is not returned in
the HTML page.
Creates a variable named Department and
sets the value equal to Sales.
CFML comment, which is not returned in
the HTML page.
Displays whatever appears between the
opening and closing CFOUTPUT tags, in
this case the text "I'd like to talk to
someone in" followed by the value of the
variable Department, which is "Sales."
Need help?
Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?
Questions and answers