Appends text to the page-output stream.
This function writes to the page-output stream regardless of
conditions established by the cfsetting tag.

writeOutput(string) → returns boolean

Argument Reference

string string

A string, or a variable that contains one

encodeFor string

CF 2016+ Lucee Wraps the result with an encodeFor function.
  • html
  • htmlattribute
  • javascript
  • css
  • xml
  • xmlattribute
  • url
  • xpath
  • ldap
  • dn

Sample code invoking the writeOutput function

writeOutput("Hello World");

greeting = "Hello World";

CF 2016+ Passing in html to the encodeFor argument wraps the result with a call to encodeForHTML.

name = "Pete";
writeOutput("Hello " & name, "html");

Expected Result: Hello Pete

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub