title: How to fire certain action before and after every ajax call
body: <p>I'm using jQuery and jQuery UI. I experienced that users sometimes fire the ajax-calls more than once, because the button/Link that triggers the call is not disabled right after they click it. To prevent that from happen, I now disable the button/link in my "beforeSend" -action.</p>
  
  <p>This is what a typical Ajax Call looks like for me:</p>
  
  <pre><code>   $.ajax({
        type: "POST",
        url: "someURL"
        data: "someDataString",
        beforeSend: function(msg){
          $(".button").button("disable");
        },
        success: function(msg){
          $(".button").button("enable");
          // some user Feedback
        }
      });
  </code></pre>
  
  <p>But I dont wann to add this button-Disable logic in every Ajax Call. Is there any way to globally define a function that gets called everytime before /after and ajax-call?</p>