Skip to content

Instantly share code, notes, and snippets.

@linus-amg
Created June 30, 2015 15:45
Show Gist options
  • Save linus-amg/febc5ab1df59c29b4a46 to your computer and use it in GitHub Desktop.
Save linus-amg/febc5ab1df59c29b4a46 to your computer and use it in GitHub Desktop.
multiple async filereader onloads
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