Global ajax handlers to execute before local ones

Global ajax handlers to execute before local ones

Hey everyone,
First time user in this forum, but it looks very nice.

I am looking for some information regarding the global ajax handlers in jquery. My situation, basically, is the following:

I would like to attach a handler that would listen for any ajax request. This handler should execute first -- before any local callbacks. It should, furthermore, execute only in case the request is successful.
Now until this moment, the only way that I could think of would be to override the ajax function in the jquery library itself. However, I dont want to do that.

Is there any other way to do this?

Thank you very much for any information