Intercept Ajax Request

Hello Guys,

I am using the scratchpad as a development tool learning how to code mods for xenforo and would like to know how i can intercept the ajax request before xenforo goes on to submit it. For example i click Button and then it goes on to perform the AutoValidator code but how would i do something before that?