![](/img/trans.png)
[英]Console.log only ever shows the original state, even though I'm 100% sure the state is being updated in React
[英]console.log and progress event - only shows when 100%
我正在测试进度条。
所以我做类似的事情:
xmlhttp.addEventListener('progress', function(event){
var percent;
if (event.lengthComputable === true) {
percent = Math.round((event.loaded / event.total) * 100);
console.log(percent);
}
});
我希望在控制台中看到多个增长百分比,就像在相关教程中看到的那样。
取而代之的是,仅使用Firebug和chrome开发器记录了100个。
怎么了 ?
谢谢,
帕特里克
在那里缺少上载: xmlhttp.upload.addEventListener('progress')
感谢Brett Caswell。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.