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中可以或得到上传进度数据

}),

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2021-11-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
相关资源
相似解决方案