If you just want to count connections, current versions of Prototype
already do that for you, via a built-in Ajax responder.
Take a look at "Ajax.activeRequestCount".
TAG
On Nov 8, 2007, at 10:14 AM, [EMAIL PROTECTED] wrote:
>
> Hi,
>
> Is there a way to get a handle to the ajax-request that gets caught by
> a responder?
> At the moment I use this:
>
> load: function(url) {
> if(Ajax.activeRequestCount < 2) {
> new Ajax.Request(
> '/people', {
> method:'get',
> onSuccess: this.parseAjaxResponse.bind(this)
> });
> } else {
> this.load.bind(this).defer(url);
> }
> },
>
> to make sure there aren't too many connections open. IE sometimes
> tripped on those.
>
> I would like to put this functionality into a responder so I don't
> have to do it everyplace i create requests.
> It would be nice if the onCreate responder was able to pause the
> creation, and resume when ready (just like above).
>
> Any possible solutions?
>
> thanks
> Mathijs
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---