XMLHttpRequest upload progress event doesn't work in Firefox 10.0.2
问题 I'm trying to create an ajax based upload form with progress bar. This is my code (the upload part of it): $xhr = new XMLHttpRequest(); $xhr.upload.addEventListener("progress", function(e) { if (e.lengthComputable) { $progress = (e.loaded / e.total) * 100; $('#file-progress').css('width', $progressWidth * (e.loaded / e.total)); $('#percentage').html($progress.toFixed(2) + '%'); } else { alert('Y U NO WORK?'); } } , false); $xhr.onreadystatechange = function(e){ if($xhr.readyState == 4) { //i