标签:margin return == 上传 ace 进度 nbsp gre 函数
var xhrOnProgress = function(fun) {
xhrOnProgress.onprogress = fun; //绑定监听函数
return function() {
var xhr = $.ajaxSettings.xhr();
if(xhrOnProgress.onprogress == null || typeof xhrOnProgress.onprogress === ‘undefined‘)
return xhr;
if(xhrOnProgress.onprogress && xhr.upload) {
xhr.upload.onprogress = xhrOnProgress.onprogress;
}
return xhr;
}
};
timeout: 1000 * 60,
xhr: xhrOnProgress(function(e) {
console.log(e)
//这里是监听函数 从e中可以或得到上传进度数据
}),
标签:margin return == 上传 ace 进度 nbsp gre 函数
原文地址:http://www.cnblogs.com/zyzhao/p/7071052.html