Created
June 30, 2015 15:45
-
-
Save linus-amg/febc5ab1df59c29b4a46 to your computer and use it in GitHub Desktop.
multiple async filereader onloads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i in files) { | |
var file = files[i]; | |
var reader = new FileReader(); | |
reader.onload = (function(detail) { | |
return function(e) { | |
var plaintext = e.target.result; | |
console.log(plaintext); | |
}; | |
})(file); | |
reader.readAsText(file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment