views:

29

answers:

1

Hello,

I have a script that needs to submit to an iframe and get a return value. However, the coldfusion page i am submitting to needs to do additional processing that has nothing to do with the return value, so I want to return the value to the iframe and then redirect the iframe to about:blank before doing the rest of the processing so that the user doesn't have to wait.

I thought cfflush would be the ideal solution here, but it only seems to work in Firefox. IE and Chrome both wait till the entire script is done running, ignoring the cfflush tag. That wont do because it may take so long to process the script( it is uploading files to an external server ) that the browser times out.

test.cfm: http://pastebin.com/Jj1njg5z

junk.cfm:

<cfset thread = CreateObject("java", "java.lang.Thread")>
About to sleep for 5 seconds...
<script>parent.loadComplete('Done Loading.')</script><cfflush>
<cfset thread.sleep(5000)>
Done sleeping.

I'm using jQuery and Coldfusion MX 6

Thanks for reading.

+4  A: 

Sometimes the browser won't "draw" when it doesn't feel like it has enough content. I've seen this quite a bit in IE. Try this:

#repeatString(" ",250)#

CF Jedi Master
That solves it, Thanks for the help!
Tentonaxe
I don't know about the current versions, but IIRC IE6 required something like 2k or EOF before it would draw anything at all.
Ben Doom