如果你刷新的AJAX请求的内容(使用ob_flush),内容会被装载? [英] If you flush the content (ob_flush) of an AJAX request, the content will get loaded?

查看:116
本文介绍了如果你刷新的AJAX请求的内容(使用ob_flush),内容会被装载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意思是让我们刚刚作出一个AJAX请求,并inser一个div#结果里面的结果。

I mean... Let's that we just make an AJAX request and inser the result inside a div#result..

在后台脚本中使用使用ob_flush()发送头,但不终止请求,直到它的终止(是退出 ob_flush_end

In the backend the script use ob_flush() to send the header but not terminate the request until it's terminated (with exit or ob_flush_end)

中的内容将被加载到#result只有当请求终止(退出 ob_flush_end ),或者它会被加载每次脚本通过发送头使用ob_flush

The content will be loaded into the #result only when the request terminate (exit or ob_flush_end) or it'll be loaded every time the script send the header by ob_flush?

更新:

我会用 jQuery的负载()发出请求和放大器; PHP来回答这个问题。

I'll use jQuery load() to make the request & PHP to answer it

推荐答案

是的,内容将被退回,但XHR对象的readyState将不会被设置为4,因此,如果你是依靠它来更新你的分区(其中大部分JS库AJAX自动更新程序做),你不会自动看到它。

Yes, content will be returned, but the XHR object's readyState will not be set to 4, so if you are relying on that to update your div (which most JS libraries' AJAX auto updaters do), you won't see it automatically.

这篇关于如果你刷新的AJAX请求的内容(使用ob_flush),内容会被装载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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