Skip to content

Commit 8bdb9cc

Browse files
data consoled / styles added
1 parent 384f4f0 commit 8bdb9cc

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎fetch/programmer-humour/script.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ const image = document.getElementById("image");
33

44
fetch(url)
55
.then((response) => response.json())
6-
.then((data) => image.src = data.img)
6+
.then((data) => {
7+
image.src = data.img;
8+
console.log(data);
9+
})
710
.catch((error) => {
811
console.log(error)
912
});

‎fetch/programmer-humour/style.css‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
body {
2+
height: 100vh;
3+
display: flex;
4+
align-items: center;
5+
justify-content: center;
6+
}

0 commit comments

Comments
 (0)