[wp-hackers] AJAX and responsiveness

Mark Jaquith mark.wordpress at txfx.net
Mon Aug 21 06:36:26 GMT 2006


On Aug 17, 2006, at 3:17 AM, Matt Mullenweg wrote:

> 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

as much as they'd mind this:

1. click
2. wait for throbber 1 to stop
1. click
2. wait for throbber 2 to stop
1. click
2. wait for throbber 3 to stop

I'd much rather have one big wait than a bunch of small ones.  With  
one big wait I can tab away and check something else for a couple  
seconds, but slowing me down between each click makes the process  
unbearable.

Next, we have to decide on immediate feedback vs. delayed feedback.

How about giving immediate feedback (comment FAT + rollup, for  
instance), but still let the user know that the action is being  
processed?  Gmail's little "loading" text in the upper right corner  
works nicely.  We need something that says "keep on clicking, while  
we work on your first click in the background"

Also, can't we use JavaScript to prevent them from clicking away  
before the AJAX requests finish?

And with regard to error returning, after the fact (i.e. they try  
foo, we give immediate feedback saying foo happened, and then on the  
backend it turns out that foo can't happen, or failed):

How many plausible cases of that are there?  Shouldn't we know ahead  
of time for most events whether or not they'll succeed, with regard  
to permissions especially?

Making a whole system for "undoing" the graphical cues for success  
may be overkill.  If something happens that we REALLY couldn't  
predict and the user REALLY needs to know, a message should suffice.   
Do we really need to rewind the interface?  That seems like a lot of  
code for a very rare event.  Of course, I'm not really a JS guy, so  
maybe it wouldn't be so hard.  Michael D Adams... Andy Skelton...  
thoughts?

--
Mark Jaquith
http://txfx.net/




More information about the wp-hackers mailing list