On Feb 16, 2006, at 8:01 AM, Ryan Hagan wrote:

> We've been using Mochikit for a while now and it has really become  
> invaluable for us.  One of the things we're doing is we're showing  
> an HTML dashboard framework (which has "pods" that can be added or  
> removed) and after the framework for all the pods is rendered  
> server side, we're using the Asynch code to load the content of  
> each pod on the dashboard.  There can be 10 to 15 pods, but each  
> user generally only has 4 or 5, so this saves us from having to  
> load all the pod contents on the server.
>
> The problem I'm seeing is that the pods seem to load one at a  
> time.  I can watch the AJAX requests all fire off pretty much at  
> once and I can see the server respond almost immediately, but the  
> pods on the dashboard all load one at a time, one after another.  I  
> would expect them all to pretty much pop onto the screen at the  
> same time.  My question is, is there something in Mochikit that is  
> causing the responses to queue up?  Why wouldn't the pods all load  
> as soon as each pod gets its data, instead of one after another?

JavaScript only has a single execution context per page, so only one  
thing can happen at a time.  The serial nature of what you're seeing  
is probably due to the time it takes for the DOM to redraw.

There's two ways to make that happen.  The ideal solution is to have  
the server send everything in one request, but you could also do it  
by collecting requests on the client side and doing the DOM updates  
in batch (can be tricky).

-bob


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to