Following is my piece of code which read file from the path specified
for (var i in e.target.files) {
var reader = new FileReader();
reader.onload = function (e) {
alert("File loaded successfully");
var output = e.target.result;
// console.log("output: "+output);
}
reader.log is asyncronous function what i want is to wait until reader.load event is fired then move to next iteration.
I also forcefully stop this by infinite for loop but my browser crashes on this. i have also tries settimeout and setinterval method but all in vain. i just to stop until reader.load event is fires and then move to next iteration.