Q:

Modify ajax response that gets passed to .done()

this.getFullAddress(id).done(function(data) {
    // need to have both the response (data) and the id
});

getFullAddress(id) {
    var response = $.ajax({
        url: 'http://whatever.com'
    }); // modify this (add id)

    return response;
}

Does anyone have an idea how to accomplish this ?

A:

Ok, found it:
getFullAddress(id) {
    $.ajaxSetup({
        dataFilter: function (response) {
            response = JSON.parse(response);
            response['id'] = id;
            response = JSON.stringify(response);

            return response;
        }
    });

    return $.ajax({
        url: 'http://whatever.com'
    });
}

