[wp-hackers] AJAX and responsiveness
Michael Gall
michael at wakeless.net
Mon Aug 21 06:44:51 GMT 2006
> The issue is twofold:
> >
> > 1. We wait for a response from the server before updating the UI
> > 2. If you try to fire off two at once, things break
>
> The first issue that should be tackled is allowing multiple events to
> be fired off at once. I don't think people would mind this:
>
> 1. click, click, click
> 2. wait for 3 throbbers to stop
We can do this with prototype....
Ajax.Responders.register({
onCreate: function() {
if($('spinner') && Ajax.activeRequestCount>0)
Effect.Appear('spinner',{duration:0.5,queue:'end'});
},
onComplete: function() {
if($('spinner') && Ajax.activeRequestCount==0)
Effect.Fade('spinner',{duration:0.5,queue:'end'});
}
More information about the wp-hackers
mailing list