延期,承诺和期货有什么区别?
这三者背后是否有普遍认可的理论?
function makeCall(file, handlerFile, sendMethod, formData) {
//console.log(instance.files);
$.ajax({
url: handlerFile,
type: sendMethod,
xhr: function() { // Custom XMLHttpRequest
var xhr = $.ajaxSettings.xhr();
if(xhr.upload) { // Check if upload property exists
xhr.upload.addEventListener('progress', progressHandlingFunction.bind(file)); // For handling the progress of the upload
//xhr.upload.addEventListener('loadend', successHandler.bind(xhr));
}
//console.log(xhr);
return xhr;
},
beforeSend: beforeSendHandler.bind(file),
success: completeHandler.bind(file),
//error: errorHandler,
data: formData, // Form data
dataType: 'json',
cache: true,
//async: false,
contentType: false,
processData: false
});
}
$(".afu-input").on('change', function() {
var i = 0;
var length = …Run Code Online (Sandbox Code Playgroud)