<cfhtmlbody>
Writes the text specified in the text attribute to the 'body' section of a generated HTML page. The cfhtmlbody tag can be useful for embedding JavaScript code, or placing other HTML tags that should go at the bottom of the page just before the closing body tag.
This tag may have a body.
This tag is also supported within <cfscript>
<cfhtmlbody
text=string
variable=string
id=string
force=boolean
action=append|read|reset|write
><!--- body --->[</cfhtmlbody>]
| Attribute | Description | Default |
|---|---|---|
text
string, optional
|
edit
The text to add to the 'head' area of an HTML page. Everything inside the quotation marks is placed in the 'head' section |
|
variable
string, optional
|
edit
Name of variable to contain the text for htmlbody. |
|
id
string, optional
|
edit
ID of the snippet that is added, used to ensure that the same snippet will not be added more than once. |
|
force
boolean, optional
|
edit
if set to true, it works even within a silent block |
|
action
string, optional
|
edit
possible actions are:
|
append |
Examples
editSimple Example
<cfhtmlhead text="Its from HTMLHEAD tag"><br>
<cfhtmlbody text="It is from HTMLBODY"></cfhtmlbody>
<cfhtmlbody action="read" variable="res"></cfhtmlbody>
<cfoutput><b>#res#</b></cfoutput>
See also
- WriteOutput()
- <cfheader>
- <cfhtmlhead>
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)