PHP是否有jQuerys阿贾克斯冲洗工作? [英] Does PHP flush work with jQuerys ajax?

查看:120
本文介绍了PHP是否有jQuerys阿贾克斯冲洗工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个页面中,我使用PHP函数flush(),将数据输出到第二个数据呼应了浏览器。我也要求使用jQuery的Ajax功能,将此页。它的工作原理,但jQuery的不输出任何东西,直到整个页面已经执行,哪一种消除冲水的功能()。

我该如何解决这个问题?

我的AJAX调用看起来是这样的:

  jQuery.ajax({
        键入:搞定,
        网址:网址,
        数据:POSTDATA,
        成功:函数(RETVAL){
             jQuery的('#retdiv)HTML(RETVAL)。
        }
})
 

解决方案

在这里,你有2个插件流:

JQUERY AJAX HTTP流 JSTREAMPLUG 的。

<一个href="http://plugins.jquery.com/taxonomy/term/1840">http://plugins.jquery.com/taxonomy/term/1840

这个插件允许与服务器保持的内容与使用一个HTTP请求的最新内容不断更新的持续连接,它扩展了$阿贾克斯,$不用彷徨,和$ .post的功能,以便流。

I have created a page in which I use the PHP function flush(), to output data to the browser the second the data is echoed. I'm also calling this page using jQuery's ajax function. It works, but jQuery doesn't output anything until the entire page has executed, which kind of removes the functionality of flush().

How can I fix this?

My ajax call looks like this:

jQuery.ajax({
        type: "get",
        url: url,
        data: postdata,
        success: function(retval) {
             jQuery('#retdiv").html(retval);
        }
})

解决方案

Here you have 2 plugins for streaming:

JQUERY AJAX HTTP STREAM and JSTREAMPLUG.

http://plugins.jquery.com/taxonomy/term/1840

"This plugin allows for a constant connection with a server keeping content continuously updated with the latest content using one http request. It extends the $.ajax, $.get, and $.post functions to allow for streaming."

这篇关于PHP是否有jQuerys阿贾克斯冲洗工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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