According to the doc, onComplete should be fired after onSuccess
http://www.prototypejs.org/api/ajax/request

On Nov 13, 1:43 am, matte <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
> Thanks for the reply.
>
> Generic Ajax.Request code:
>
> new Ajax.Request(URL, {
>         method: 'post',
>         parameters: OPTIONS,
>         onSuccess: function(transport) { console.log('Request success'); }
>
> });
>
> And my extension:
>
> Ajax.Responders.register({
>         onComplete: function(request) {
>                 console.log('Global success');
>         }
>
> });
>
> 'Global success' message logged everytime an Ajax.Request is
> completed. But the problem is that 'Global success' message is logged
> after 'Request success' message. What i want is to be able to check
> response and validate (if necessary, stop onSuccess event) before
> every Ajax.Request onSuccess event called.
>
> On Nov 13, 11:34 am, "Alex Mcauley" <[EMAIL PROTECTED]>
> wrote:> perhaps put your code up so someone can evaulate it and put forward a
> > suggesiton ?
>
> > ----- Original Message -----
> > From: "matte" <[EMAIL PROTECTED]>
> > To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
> > Sent: Thursday, November 13, 2008 9:30 AM
> > Subject: [Proto-Scripty] Extending every Ajax.Request onSuccess event
>
> > > Hi,
>
> > > I have an application that uses Ajax.Request and its onSuccess event
> > > handler in lots of places.
>
> > > I need to call a function (that will check the response) before all
> > > these onSuccess events fired. I tried using  Ajax.Responders.register
> > > with onComplete event but it fires after Ajax.Request's onSuccess
> > > event. Any suggestions?
>
> > > Thanks,
> > > Mert.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to