No. Ok, so what do I mean? Imagine this simple code:
<h2>Flush Test</h2>
<cfdiv bind="url:testi.cfm" >
This page will load, create the div, and then load testi.cfm into the div. What does testi.cfm do?
<p>
This is how we start...
</p>
<cfoutput>#repeatString(" ", 250)#</cfoutput>
<cfflush>
<cfset sleep(2000)>
<p>
This is how we end later on....
</p>
As you can see - I have an intro paragraph, a flush, a pause (the sleep function), and the rest of the text. When you load the file in your browser, ColdFusion will not display the results in the div until the page is completely done.
Archived Comments
I have played around with exactly the same problem.
I saw the problem when trying to add javascript (in the returned ajax html). It looks like that the javascript is not able to work with the "global" javascript variables and functions.
I was trying to make some elements drag'able to a specific source with dhtmlgoodies' library.
Did you define your JS functions like so:
foo = function(...) {
Thanks for the tip Ray. I was playing around with similar code today, but hadn't gotten to the point of flushing out the progress (and now I won't have to bang my head against the wall wondering what I did wrong).