I'd like to handle some custom data in global ajaxComplete and ajaxSent event. In my case, I want info about the zone that will be updated. ex. of what I want to achive.
$.get(
'http://someUrl',
{ param : value, param2: value2 },
'extraData', //<-- here, for exemple
function (data){
}
);
$(document).ajaxSend(function(e, xhr, options){
var data = //Some way to get back 'extraData';
doSomethingWhenSendingRequest(data);
});
$(document).ajaxComplete(function(e, xhr, options){
var data = //Some way to get back 'extraData';
doSomethingWhenRequestCompleted(data);
});
I need the same with $.post, $.getJSON... Is there a built-in way to achieve this?