Saturday, September 03, 2005

CFFLUSH Example

Cut and paste this code into an editor to test CFFLUSH:

<cfparam name="url.mode" default="tbl">
<cfif url.mode eq "tbl">

<table>
<tr>
<td><cfoutput>Please wait while I count: <a href="#getfilefrompath(cgi.script_name)#?mode=div">Try Div Mode</a></cfoutput></td>
</tr>
<cfflush>

<cfloop from="1" to="100000" index="i">
<cfif i mod 100 eq 0>
<tr>
<td style="color:blue;"><cfoutput>#i#</cfoutput></td>
</tr>
<cfflush>
</cfif>
</cfloop>
</table>

<cfelse>
<div>Please wait while I count: <cfoutput><a href="#getfilefrompath(cgi.script_name)#">Try Table Mode</a></cfoutput></div>
<cfflush>

<cfloop from="1" to="100000" index="i">
<cfif i mod 100 eq 0>
<div style="color:red;"><cfoutput>#i#</cfoutput></div>
<cfflush>
</cfif>
</cfloop>
</cfif>

1 Comments:

Blogger Fernanda said...

Bad example!
The code works the same if you remove the cfflush tags

11:42 AM  

Post a Comment

<< Home