HTML5 File API: How to see the result of readAsText()

来源:互联网 发布:网络水军有多少 编辑:程序博客网 时间:2024/04/29 22:24

http://stackoverflow.com/a/13729386/2177408

readAsText is asynchronous, so you would need to use the onload callback to see the result.

Try something like this,

var fr = new FileReader();fr.onload = function(e) {    // e.target.result should contain the text};fr.readAsText(file);

0 0
原创粉丝点击