开发者

Mootools: Why every flush() in PHP doesnt reflect at user side in mootools events

i am developing an application in mootools.There is some code which sends request to server using Request class.

req = new Request({
async: false, method: 'post',

someEvent: function(currentC开发者_开发知识库hunk) 
{ /* this event is fired everytime when server flushes the output using flush()*/ },

  onSuccess: function(html) { responseProcessor(); },
  onFailure: function() { alert('Page Loading Failed ....!!'); },
});

At the server side, it executes a PHP file where i am flushing output buffer using flush(). but at receiving end, there is onSuccess event which gives me whole responseData in one variable.

Is there any event which is fired after every single time server flushes the output buffer.?


there is an progress event documented on the API: http://mootools.net/docs/core/Request/Request


The onSuccess callback passes the whole response as parameter. If you make an AJAX call, it returns as response all the stuff that would be rendered on the browser if you accessed that script directly. With mootools Request you can't show the progression of the output (there couldn't be events called after a flush). I don't know if there is a moo plugin that does something like this.

p.s. I know there's a jQuery plugin that could do something for you (Does PHP flush work with jQuerys ajax?)


I checked the JQuery AJAX Http Stream plugin pointed out from the link steweb included in his anwser.

All it does is just a polling. You could extend the MooTools.Core.Request class and create a MooTools.Core.Request.Polling class which would add some options like the polling.

You will need to implement the 'request' event (triggered just before the request is sent) to set up the polling and the complete event to stop it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜