How to run jquery codes before and after ajax call? I want to create a loading code while the ajax call is not yet complete, AND enable my jquery code after calling the ajax of drupal form. The ajax I'm referring to is the "Add new field/Add more" of unlimited field. I don't have a custom module for that. I'm just using what drupal already has.

This is the code that triggers the Ajax of the form:

$('input[name="field_collection_add_more"]').mousedown();


I can't use the $(document).ajaxComplete(function(){}); nor ajaxStart
function of the jquery because I only want my functions to run on that specific ajax call for that specific field.

How can I use the beforeSend: and success: when the ajax add new field is running? 

Thank you in advance for the help!
/**
 * Special Effects AJAX framework command.
 */
Drupal.ajax.prototype.commands.nameOfCommand =  function(ajax, response, status) {
  alert("Hello I'm Maged Eladawy...")  ; // this will be executed after the ajax call
}


More details