Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <script type="text/javascript">
- function readTextFile(filePath)
- {
- var rawFile = new XMLHttpRequest();
- rawFile.open("GET", filePath, false);
- rawFile.onreadystatechange = function ()
- {
- if(rawFile.readyState === 4)
- {
- if(rawFile.status === 200 || rawFile.status == 0)
- {
- var allText = rawFile.responseText;
- document.write(allText);
- }
- }
- }
- rawFile.send(null);
- }
- </script>
- </head>
- <body>
- <script type="text/javascript">
- readTextFile("file:///D:/Web/dane.txt");
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement