Function analyze() {var f =new filereader();
F.onloadend= function()
{console.log ("success"); }
F.readastext ("filename.txt");
}
But i suggest you use ajax, encoding the fille in json format , rather than plain text, if you use jquery you can then use $.getJSON('filename.txt') to read file and parse it into a javascript object in one operation.
Comments