zoukankan      html  css  js  c++  java
  • ajax监听上传进度

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

    }),

  • 相关阅读:
    Chat Icon
    docker 容器无root 权限,如何获得docker容器里面的root权限
    yolo训练自己的数据
    jetson nano(1-1) 系统烧录和备份
    jetson nano(2)软件环境开发
    jetson nano(1-2)配置VNC
    坐标映射(remap重映射)
    opencv图像格式
    matlab相机标定导出xml文件
    jupyter安装和链接aconda
  • 原文地址:https://www.cnblogs.com/zyzhao/p/7071052.html
Copyright © 2011-2022 走看看