I'm trying to test a function, that returns a Blob
of a CSV, it has a type, name etc and alerting that returns this:
Object{size: 9, type: 'text/csv;charset=utf-8;', name: 'Test'}
and it is an instanceOf Blob
as well.
I tried doing this consulting this question...
var fr = new FileReader();
fr.onload = function(e) {
return e.target.result;
};
alert(fr.readAsText(blob));
alert(blob instanceof Blob);
Though no luck, the first alert call just returns undefined
.
ALERT: undefined
ALERT: true
Any help with doing this? How can I convert the CSV blob content to a String that I can then read and test the result of the content in the CSV?