Created
October 4, 2012 18:32
-
-
Save ff6347/3835492 to your computer and use it in GitHub Desktop.
Load Text file and show in alert()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var txtfile = File.openDialog ("Choose a textfile for filling", "*.txt", false); | |
// It works like this. | |
// test if txtfile is not null | |
if(txtfile != null){ | |
txtfile.open("r"); | |
content = txtfile.read(); | |
txtfile.close(); | |
alert(content); | |
}else{ | |
alert("You did not select a file"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment