Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

进度条是用定时器写的,而并非所写的实时进度条 #1

Closed
jingshuiliushen810 opened this issue Feb 5, 2018 · 1 comment

Comments

@jingshuiliushen810
Copy link

这个插件,除了进度条不是实时显示外(由定时器触发),其他功能就非常齐全完美了,如果可以把进度条实时化,就太完美了。

@jingshuiliushen810
Copy link
Author

在作者的基础上进行改进,弃用由定时器模拟的非实时进度条效果,改由实时的进度条显示。具体方法主要是利用jquery的ajax的xhr这个api,增加 xhr: function(){},根据$.ajaxSettings.xhr()这个对象里的loaded值来判断真正的加载进度,具体改进的源码如下链接,其对应的是该插件源码里的easyUpload.js,用Beyond Compare 3比较软件比对下代码就可以发现二者的代码差异。说到这里,其实该插件是非常轻量的,纯粹是利用ajax来进行自定义的上传插件,不过当前的插件还不够完善,因为当前还发现有两个问题:1、不支持并行多文件上传,而是串行的。2、限制的文件上传个数,使用的变量名为multiNum,与这个变量的真正含义不一致。要表达的就这么多了。如果我有时间把这两个问题也解决了,我也会提交Issues的。

easyUpload.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant