Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readTextFile(file)
- {
- var rawFile = new XMLHttpRequest();
- rawFile.open("GET", file, false);
- rawFile.onreadystatechange = function ()
- {
- if(rawFile.readyState === 4)
- {
- if(rawFile.status === 200 || rawFile.status == 0)
- {
- var allText = rawFile.responseText;
- alert(allText);
- }
- }
- }
- rawFile.send(null);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement