Description
Appends text to the page-output stream. This function writes to the page-output stream regardless of conditions established by the cfsetting tag.
Category
Other functions, System functions, Data output functions
Appends text to the page-output stream. This function writes to the page-output stream regardless of conditions established by the cfsetting tag.
Other functions, System functions, Data output functions
WriteOutput(string [,encodefor])
Introduced in ColdFusion 4.5
Parameters
Parameter |
Description |
---|---|
string |
A string or a variable that contains one. |
encodefor |
This attribute's functionality is similar to the 'encodeFor' functions. The valid values are |
Within the cfquery and cfmail tags, this function does not output to the current page; it writes to the current SQL statement or mail text. Do not use WriteOutput within cfquery and cfmail. Although you can call this function anywhere within a page, it is most useful inside a cfscript block.
<cfscript> // encodeFor=url writeoutput("encoding for url: "); writeoutput("lorem ipsum _*&%^$%&@","url"); </cfscript>
<cfscript> // encodeFor=html writeoutput("encoding for html: "); writeoutput("lorem ipsum _*&%^$%&@","html"); </cfscript>
The example above produces the output:
encoding for html: lorem ipsum _*&%^$%&@
<cfscript> // encodeFor=css writeoutput("encoding for css: "); writeoutput("lorem ipsum _*&%^$%&@","css"); </cfscript>