I was trying to work out how to do this myself on Monday! The answer
is Ajax Responders, http://www.prototypejs.org/api/ajax/responders .
Note though that the API is wrong - onSuccess/onFailure/onXYZ
callbacks are not available. The best solution to this I think is to
switch on response.status in an onComplete callback registered through
responders.

Interestingly it is also possible, with an onCreate callback, to
modify the url - I've used this as every ajax request should always be
sent to the same place (ajax_handler.php) on my site, so that's come
in very useful for me. I tried also editing the options with an
onCreate - it works, but then when the options are extended, the
overwritten options are cloned which for some reason reverts back to
the pre-onCreate callback options.

On Sep 12, 9:35 am, Marcelius <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I'd like to know if it is possible to add an 'system wide'
> notification when ANY Ajax.Request or Ajax.Updater is executed? I want
> to use this kind of behavior to show some sort of indicator to the
> user that content will be updated shortly, or when a request is
> pending. Yes I know I could use onComplete or something like that but
> that meens I'll have to add that piece of code on every Ajax call and
> since my project consists over 5000+ lines of code or so, a different
> approuch would be helpfull :-)
>
> I was thinking of for example extending the Ajax.Updater class in the
> initialize method so I can execute my code first (eg showing an
> indicator) and than call the 'parent' initialize method.
>
> Is this the best thing to do, if so, how do I exactly extend that
> method? I prefer not to change the prototype.js core code for future
> update reasons :-)
>
> Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
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