Skip to content

Instantly share code, notes, and snippets.

@kuyseng
Created May 26, 2012 03:48
Show Gist options
  • Save kuyseng/2792041 to your computer and use it in GitHub Desktop.
Save kuyseng/2792041 to your computer and use it in GitHub Desktop.
javascript: read text file
function read_text_file (file) {
if(file !=null) {
var all_string = "";
file.open("r");
while(!file.eof) {
all_string += (file.readln() + "\n") ;
};
file.close();
};
return all_string;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment