I am trying to overwrite the success function upon ajaxsend event but it doesnt work here is the code:
$(document).ajaxSend(function(event,xhr,options){
console.log('ajaxSend');
var tempSuccess = options.success;
options.success = function(data, textStatus, jqXHR){
console.log('start');
tempSuccess(data, textStatus, jqXHR);
console.log('end');
}; xhr.success = options.success;});
upon AJAX I do see 'ajax' in the console, but upon success I can't see the start and the end debug msges..
What do I do wrong?