Looping through jQuery Deferreds after all promises have been called
问题 I am currently trying to build a File Uploader using the HTML5 FileAPI. The File Uploader is supposed to handle multiple files and show image previews if the file is an image. since the FileReader class works asynchronously I want to wait until all the the files have been read. Therefore I am using Deferreds. A method which reads the file is returning a promise. Another method loops through all files and pushes all promises into an array. Then I\'m applying the then() method once all promises