First off thanks to all developers of prototype and script.aculo.us
for a fantastic framework, also to Andrew Dupont's book on the subject
which I just spent a weekend devouring! And thanks in advance for
anyone who can answer the following question!
I'm looking to always be able to fire certain events or call certain
functions whenever an Ajax request of any kind is made.
Specifically, whenever a request of any kind is created, I want a
loading icon in the bottom left of the viewport. I want to always deal
with the onFailure callback by showing an error sign and message
(generated by the server) in the same place. the onSuccess callback
should first hide the loading image then go off and do whatever I
specify with the onSuccess calback of that Ajax request instance.
So what's the best way to go about this?
I thought about extending the prototype classes but I have some
worries - firstly, I'd have to extend all 3 of the main ajax classes
(Request, Updater, PeriodicalUpdater) and I might have problems with
other objects which I wouldn't be able to redirect to my ajax classes
(e.g. InPlaceEditor). I'd also worry about my code breaking with
future Prototype versions. Also although I've learnt how to subclass
prototype defined classes, I'm not sure what the best way of appending
another event or function to each callback would be.
Is this the right approach to take? If so, how can I get around the
worries I have? Is there a better way to do this?
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 firstname.lastname@example.org
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at