Skip to content

Commit f95be4e

Browse files
committed
changed simpleFetch.js
1 parent 3a1fdf1 commit f95be4e

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
//setTimeout(function() {
2-
getText("https://temp.staticsave.com/67d53f98ba08b.txt");
3-
//}, 8000);
4-
/*
5-
setTimeout(getTxt(), 8000);
6-
7-
function getTxt(){
8-
getText("https://temp.staticsave.com/65d8d1d3d272f.txt");
9-
}
10-
*/
111
async function getText(file) {
122
let myObject = await fetch(file); // myObject is the response object of the fetch()
133
let myText = await myObject.text(); // text() method of response object returns a promise that resolves to a string
144
document.getElementById("demo").innerHTML = myText;
15-
}
5+
}
6+
7+
//setTimeout(function() {
8+
getText("https://temp.staticsave.com/69b491b0ec093.css");
9+
//}, 8000);

0 commit comments

Comments
 (0)