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 )开发者_如何学C 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
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:
<cfoutput>#repeatString(" ",250)#</cfoutput>
精彩评论