CFFlush在Chrome和IE中似乎不起作用 [英] CFFlush doesn't seem to work in Chrome and IE

查看:246
本文介绍了CFFlush在Chrome和IE中似乎不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本,需要提交给iframe并获取返回值。但是,我要提交的Coldfusion页面需要​​执行与返回值无关的其他处理,因此我想将值返回到iframe,然后在执行其余处理之前将iframe重定向到about:blank这样用户不必等待。

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.

我认为cfflush是这里的理想解决方案,但它似乎只能在Firefox中工作。 IE和Chrome都等到整个脚本运行完毕,而忽略cfflush标签。这样做不会做,因为处理脚本可能需要很长时间(它将文件上传到外部服务器),以至于浏览器超时。

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

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.

我正在使用jQuery和Coldfusion MX 6

I'm using jQuery and Coldfusion MX 6

感谢阅读。

推荐答案

有时候,浏览器在感觉不舒服时不会绘制足够的内容。我已经在IE中看到了很多。尝试以下操作:

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>

这篇关于CFFlush在Chrome和IE中似乎不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆