I would probably send all stuff in a single request. Maybe build up a
single string with that loop and send it like "your/url/?
div[0]=a&div[1]=b" etc. Just my two cents, but I think it would reduce
the traffic too. Whatever, I've been doing ajax only some months now.

Ta.


On May 24, 11:54 pm, Zedsquared <[EMAIL PROTECTED]> wrote:
> Hi Folks,
>          I need to fire off the same ajax request for many elements on
> a page, if I were to do something like:
>
> (given divs[] array is filled with the elements I wish to process)
>
> for ( i=0;i<divs.length;i++) {
>  new Ajax.Request('/your/url', {
>   onSuccess: fillit(divs[i],transport)
>  other parameters here:
>  }
>
> }
>
> function fillit(destination,transport) {
> destination.innerHTML=transport.responseText
>
> }
>
> Would the requests all be queued up nicely and execute in turn or
> would they overlap so that only the last one really gets processed
> properly?
>
> many Thanks,
>                  Robin.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to