Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Title</title>
- </head>
- <body>
- <p id="texter"></p>
- <script>
- // let x ;
- // fetch('pacient.txt')
- // .then(response => response.text())
- // .then(text => x);
- // console.log(x);
- // document.getElementById("texter").innerHTML = x.toString();
- const logFileText = async file => {
- const response = await fetch(file);
- const text = await response.text();
- console.log(text);
- document.getElementById("texter").innerHTML = text;
- };
- logFileText('pacient.txt');
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment