is it possible (ajax)

is it possible (ajax)

hey guys i have a function like so:
  1.     function ajax(type, url, data){
            return $.ajax({
                    type: type,
                    url: url,
                    data: data,
                    cache: false,
                    processData: false,
                    contentType: false,
                    dataType: "text"
                });
        }

i'm able to call for success and error function like so:

  1. var upload = ajax('POST', 'save.php', data);

     upload.success(function (src) {
                          
     });
                                         
    upload.error(function (data) {

    });


but what i've been trying to accomplish is to get the xhr function but i'm having no luck.


  1. upload.xhr(function () {
                          
     });


is what I'm trying to do possible please?


thank you