Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function gotFile(file){
- readAsText(file);
- }
- function readAsText(file) {
- var reader = new FileReader();
- reader.onloadend = function() {
- var string = evt.target.result;
- };
- alert(string) // returns null
- reader.readAsText(file);
- }
- function gotFile(file){
- readAsText(file,function(str){
- return str;
- });
- }
- function readAsText(file,callback) {
- var reader = new FileReader();
- reader.onloadend = function() {
- callback(reader.result);
- };
- reader.readAsText(file);
- alert(callback);
- }
- function(str){
- return str;
- }
- function gotFile(file){
- readAsText(file,function(str){
- alert(str);
- });
- }
- function readAsText(file,callback) {
- var reader = new FileReader();
- reader.onloadend = function() {
- callback(reader.result);
- };
- reader.readAsText(file);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement