• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 18. Scripting > Writing Output

18.2. Writing Output

You can't directly output text or variable values to the browser within a CFSCRIPT block. There is, however a function called WriteOutput( ) that you can use to write directly to the page output stream. This technique can output both variable values and plain text from within a CFSCRIPT block. Example 18-1 demonstrates the WriteOutput( ) function.

Example 18-1. Using the WriteOutput Function Within a CFSCRIPT Block

<H2>Using WriteOutput Within CFSCRIPT</H2>

<CFSCRIPT>
 x = 1;
 y = 2;
 MyMessage = "Hello World";
 
 WriteOutput("x = #x# <BR>");
 WriteOutput("MyMessage = #MyMessage# <BR>");
 WriteOutput(x+y); 
</CFSCRIPT>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint