Guest User

Untitled

a guest
Nov 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. </head>
  7. <body>
  8. <p id="texter"></p>
  9. <script>
  10. // let x ;
  11. // fetch('pacient.txt')
  12. // .then(response => response.text())
  13. // .then(text => x);
  14. // console.log(x);
  15. // document.getElementById("texter").innerHTML = x.toString();
  16.  
  17. const logFileText = async file => {
  18. const response = await fetch(file);
  19. const text = await response.text();
  20. console.log(text);
  21. document.getElementById("texter").innerHTML = text;
  22. };
  23.  
  24. logFileText('pacient.txt');
  25. </script>
  26. </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment