Could you please try this? You are not calling r.readAsText
that is why your onload function is not being triggered.
$(document).ready(function(){
$('input').on('change', function(evt){
var f = evt.target.files[0];
if (f){
var r = new FileReader();
r.onload = function(e){
console.log(e.target.result);
};
r.readAsText(f);
} else
{
console.log("failed");
}
});
});
http://www.htmlgoodies.com/beyond/javascript/read-text-files-using-the-javascript-filereader.html#fbid=wZLjbp74Xxk
Other than readAsText, there are other methods that you can use depending on how you want the uploaded file to be read.
FileReader.readAsArrayBuffer()
Starts reading the contents of the specified Blob, once finished, the result attribute contains an ArrayBuffer representing the file's
data.
FileReader.readAsBinaryString()
Starts reading the contents of the specified Blob, once finished, the
result attribute contains the raw binary data from the file as a
string.
FileReader.readAsDataURL()
Starts reading the contents of the specified Blob, once finished, the
result attribute contains a data: URL representing the file's data.
FileReader.readAsText()
Starts reading the contents of the specified Blob, once finished, the
result attribute contains the contents of the file as a text string.
(Source: https://developer.mozilla.org/en/docs/Web/API/FileReader)