MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual page 32

Table of Contents

Advertisement

12
Original ColdFusion page
<html>
<head>
<title>Call Department</title>
</head>
<body>
<strong>Call Department</strong><br>
<!--- Set all variables --->
<cfset department="Sales">
<!--- Display results --->
<cfoutput>
I'd like to talk to someone in
#Department#.
</cfoutput>
</body>
</html>
Reviewing the code
The application page that you just created contains both HTML and CFML. You used
the CFML tag
then used the CFML tag c
following table describes the code and its function:
Code
<!--- Set all variables --->
<cfset Department="Sales">
<!--- Display results --->
<cfoutput>
I'd like to talk to someone in
#Department#.
</cfoutput>
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 is returned to the browser.
to define a variable, Department, and set its value to "Sales." You
cfset
Chapter 2 Writing Your First ColdFusion Application
HTML file returned by Web server
<html>
<head>
<title>Call Department</title>
</head>
<body>
<strong>Call Department</strong><br>
I'd like to talk to someone in Sales.
</body>
</html>
to display text and the value of the variable. The
foutput
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
text "I'd like to talk to someone in" is followed by
the value of the variable Department, which is
"Sales."
tags; in this example, the
cfoutput

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents