Fine Uploader 的 onProgress() 回调在 Android 设备上不起作用。这是我的代码:
onProgress: function(id, fileName, loaded, total)
{
//alert('debug'); this alert shows after download is completer
if (loaded < total) {
progress = '"' + fileName + '" uploaded ' + Math.round(loaded / total*100) +'%';
$('#progress').html(progress);
}
else {
$('#progress').html('saving');
}
}
onProgress() 在上传完成后调用。可能出现什么问题以及如何解决?
在官方文档它说:onProgress(String id, String name, int uploadedBytes, int totalBytes) - called during the upload, as it progresses. Only used by the XHR/ajax uploader.
经过一番挖掘后,我确定——在撰写本文时——Android 4.0.4 的原生浏览器确实如此not全力支持XMLHttpRequest 规范。具体来说,XMLHttpRequest 对象不会触发进展事件这对于确定当前上传文件的进度至关重要。
我尝试将事件处理程序绑定到onprogress
事件以多种方式进行,甚至遵循Mozilla 开发者网络文章,但无济于事。
The onprogress
事件在 Android 版 Chrome 上正确触发。
我已备案我们的跟踪器存在问题。希望能找到解决方法,或者谷歌等人。解决这个问题。
如果您对解决方法有任何建议,请随时分享
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)