Skip to content

Commit 0c94e34

Browse files
Web API
1 parent 5f50ff5 commit 0c94e34

File tree

4 files changed

+102
-0
lines changed

4 files changed

+102
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
GIG FRONT END WEB DEVELOPER(MAIN) GIG TWO NFT WEBSITE GIG THREE PSD TO HTML
2+
3+
DAY1| 305 ----video (Day1)
4+
DAY2| 320 ----without Video {PAGE 2-LINE3 50 49
5+
DAY3| 378 ----changed picture + keyword P-2(L-4(1) 72 51
6+
DAY4| 385 ----changed picture + keyword P-2 91 53
7+
DAY5| 372-----not worked P-2 L-3(4) 112 7 (NEW)
8+
DAY6| 356-----change picture P-2 L-3(2) 130 11(NEW)
9+
DAY7| 380-----changed picture P-2 L-4(4) 144 51
10+
DAY8| 381-----nothing P-2 L-2(4) 166 64
11+
DAY9| 285-----nothing P-2 L-4(2) 100 87
12+
DAY9| 264----nothing P-2 L-7(3) 82 93
13+
DAY10| 232----nothing P-2 L-8(3) 92 62
14+
DAY11| 225----nothing P-2 L-8(5) 100 53
15+
DAY12| 246----change picture + keyword P-2 L-4(0) 73 19
16+
DAY13| 267----video P-2 L-2(2) 54 13
17+
DAY14| 270-----keyword P-1 L-10(4) 68 8
18+
DAY15 283----nothing P-1 L-11(2) 71 8
19+
20+
21+
22+
Loading
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Fetch API</title>
9+
</head>
10+
11+
<body>
12+
<h1>Fetch API</h1>
13+
<!-- Documentation -->
14+
<button onclick="DisplayOne()">View Doc</button>
15+
<p id="textOne"></p>
16+
<!-- Example One -->
17+
<h2>Fetch API Method One</h2>
18+
<button onclick="DisplayTwo()">click</button>
19+
<p id="textTwo"></p>
20+
<!-- Example Two -->
21+
<h2>Fetch API Method Two</h2>
22+
<button onclick="DisplayThree()">click</button>
23+
<p id="textThree"></p>
24+
<!-- Example Three -->
25+
<h2>Fetch API Method Three</h2>
26+
<button onclick="DisplayFour()">click</button>
27+
<p id="textFour"></p>
28+
<script src="script.js"></script>
29+
</body>
30+
31+
</html>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Fetch API
2+
let textOne = document.getElementById('textOne');
3+
4+
function DisplayOne() {
5+
textOne.innerHTML = `
6+
<p>The Fetch API interface allows web browser to make HTTP requests to web servers.
7+
😀 No need for XMLHttpRequest anymore.</p>
8+
<h3>Understand the Below Example
9+
</h3>
10+
`
11+
}
12+
13+
// Example 1 : Fetch API : Simple Way to understand
14+
let textTwo = document.getElementById('textTwo')
15+
16+
function DisplayTwo() {
17+
let file = "FIVERR.txt"
18+
fetch(file)
19+
.then(x => x.text())
20+
.then(y => textTwo.innerHTML = y);
21+
}
22+
23+
// Example 2 : Fetch API : Better Way of UnderStanding
24+
25+
let textThree = document.getElementById('textThree')
26+
27+
function DisplayThree() {
28+
getText("FIVERR.txt");
29+
30+
async function getText(file) {
31+
let x = await fetch(file);
32+
let y = await x.text();
33+
textThree.innerHTML = y;
34+
}
35+
}
36+
37+
// Example 3 : Fetch API : Best Way of UnderStanding
38+
39+
let textFour = document.getElementById('textFour')
40+
41+
function DisplayFour() {
42+
getText("FIVERR.txt");
43+
44+
async function getText(file) {
45+
let myObject = await fetch(file);
46+
let myText = await myObject.text();
47+
textFour.innerHTML = myText;
48+
}
49+
}

0 commit comments

Comments
 (0)