1.1: fetch() - Working With Data & APIs in JavaScript

1.1: fetch() - Working With Data & APIs in JavaScript

The Coding Train

5 лет назад

451,930 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

okoh lawrence
okoh lawrence - 13.11.2023 23:36

You're extremely good

Ответить
Innocent Nwafor
Innocent Nwafor - 02.10.2023 13:05

Where is the image stored, I'm confused

Ответить
Tan Cannon
Tan Cannon - 01.09.2023 07:03

Can we use the result fetched globally?!

Ответить
Kashyap
Kashyap - 20.08.2023 10:03

I feel happy while studying from you.

Ответить
Unsolved Questions
Unsolved Questions - 20.07.2023 07:51

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="" alt="nothing" id="rainbow" width="100%">
<script>
console.log('About to fetch Data');
fetch('rainbow.jpg')
.then(response => {
console.log(response);
return response.blob();
})
.then(blob => {
console.log(blob);
const imgUrl = URL.createObjectURL(blob);
document.getElementById('rainbow').src = imgUrl;
})
.catch(error => {
console.error('Error fetching the image:', error);
});
</script>
</body>
</html>

Ответить
Chris Calver
Chris Calver - 07.07.2023 00:41

Great vid tks

Ответить
Omar Hassan
Omar Hassan - 18.05.2023 15:40

how to add mutiple images

Ответить
Omar Hassan
Omar Hassan - 18.05.2023 12:21

since its not working

Ответить
Omar Hassan
Omar Hassan - 18.05.2023 12:17

one question did you already save the image already in your folder or just get through the object url ??

Ответить
A. . . ..
A. . . .. - 02.05.2023 11:23

im getting error failed, reason: Parse Error: Invalid header token
i dont know why

Ответить
Niraj Deshmukh
Niraj Deshmukh - 28.03.2023 20:16

Wow.. this tutorial is perfect to context which gives real world example. Thank you very much.

Ответить
Rob Scherer
Rob Scherer - 21.03.2023 22:35

Did I miss the part where the rainbow.jpg is created and referenced?

Ответить
Dox Wilde
Dox Wilde - 16.03.2023 14:58

I get upset when I see so much traffic on my road to greatness..API 400k views 😒

Ответить
himanshu arora
himanshu arora - 12.03.2023 15:09

what is blob() in here ,,i mean how are u using response.blob() ,,,,,where it is defined ????

Ответить
Fut Incrível!
Fut Incrível! - 17.02.2023 03:17

This is a BRILLIANT lesson! Its very good. Thank you

Ответить
Kashiya Mwape
Kashiya Mwape - 13.02.2023 10:31

Thank you for the videos!! so i managed to do the Fetch() API successfully . I now want to pass the SRC with the encrypted payload to a browser . How can i achive that please assist ?

Ответить
Chris Reed
Chris Reed - 24.01.2023 22:46

Dude you are amazing!! Fantastic video!

Ответить
jithin surendran
jithin surendran - 22.01.2023 21:53

smol doubt, I tried fetch first rainbow part, but Im getting false, 404

Ответить
Papy Oles
Papy Oles - 12.01.2023 20:14

This is soo informative and well done! I love your enthusiastic voice tone. I can't thank you enough. 👍🏽👍🏽👍🏽👍🏽👍🏽

Ответить
Felipe F. Tavares
Felipe F. Tavares - 10.01.2023 17:14

The exercises in the final part are really good! I used other API called dummyjson to put a random quote with the author of the quote in the page. Each time i reload the page is a different quote.

Ответить
Trae Zeeofor
Trae Zeeofor - 03.01.2023 16:14

Thanks for this video man, and grateful for google for linking it as 3rd option for beginners looking for practical fetch API lessons.👍

Ответить
DANser
DANser - 15.12.2022 19:17

Finally, I freakin did it yes! Thank you!

Ответить
hc greier
hc greier - 27.11.2022 17:55

A massive thanks from here for your instructive lessons and your effort you're putting in this!
Bow!

Ответить
Santiago Cuadra
Santiago Cuadra - 20.11.2022 22:52

i'm glad to know english, just to say: thank you for all effort put on those videos.

Ответить
denno jm
denno jm - 07.11.2022 02:36

You are a saviour

Ответить
AlphastepMusic
AlphastepMusic - 04.10.2022 03:28

I've been looking for this for a very long time!

Ответить
Abdel - Karim Osmanu Azumah
Abdel - Karim Osmanu Azumah - 01.10.2022 16:02

i never really understood how to use api until i watched ur vid .

Ответить
Muhammad Hassaan
Muhammad Hassaan - 26.09.2022 20:28

best teacher :)

Ответить
Mira Matrix
Mira Matrix - 24.09.2022 01:53

I like how he made everything fun, even a person with no programming background can understand his explanation... I wish they taught me this way from the start

Ответить
mariana mena
mariana mena - 16.09.2022 19:15

You are a treasure, thank you!

Ответить
Kernix
Kernix - 11.09.2022 00:24

Excellent - thanks! Just subscribed and will be watching some more videos related to fetch and async await.

Ответить
omargian_stw
omargian_stw - 30.08.2022 06:15

Good fetch tutorial thanks. I have a question, Can I use fetch in combination with setInterval? The thing is that I have a json file that update every 10 seconds, and I need get the current data, to print in the html and handle the same data to do another stuff. What do you recommend to me?

Ответить
Bernard Sam Apoh
Bernard Sam Apoh - 27.08.2022 09:15

Really like your style of teaching. You simplify concepts to the basic.

Ответить
Prasad Lakshan
Prasad Lakshan - 23.08.2022 07:46

Superb explanation

Ответить
Lenny Laserdisk
Lenny Laserdisk - 20.08.2022 12:32

I notice that whenever I refresh my API the indexation changes. Any idea on what to do in this situation?

Ответить
théodore dwernicki
théodore dwernicki - 29.07.2022 12:48

Merci !

Ответить
Tiffany Gibbel
Tiffany Gibbel - 29.07.2022 02:20

You and your channel are brilliant

Ответить
usurper👻🕷
usurper👻🕷 - 20.07.2022 23:47

Been coding in C the past couple months can’t wait to come back to JavaScript.

Ответить
Carlos López
Carlos López - 19.07.2022 01:23

Greate info! thank you so much!

Ответить
Marko Giovanni
Marko Giovanni - 03.07.2022 18:38

Hello Community, Anyone else could explain me with an easey way. What is a blob? im getting stucked understanding the blobs

Ответить
ALTHEPAL78
ALTHEPAL78 - 01.07.2022 02:12

You are my favorite teacher because you are so fun to watch so happy and animated thank you so much :)

Ответить
Jack Epner
Jack Epner - 28.06.2022 16:50

CORS errors trying to fetch image - first read it's because it's local, so tried fetching from URL I hosted it, still CORS error. Solutions look absurd, setting up reverse proxies on the network just to complete a simple js tutorial.... any thoughts?

Ответить
King Osei
King Osei - 08.06.2022 20:46

I find it difficult to figure out where the "rainbow.jpg" comes from

Ответить
Ismail Ahmad
Ismail Ahmad - 03.06.2022 05:54

This stuff wasn't really setting right with me before. You helped me figure it click for me but that wasn't the best part of the video. You make it fun. Life doesn't have to be boring, why not make it fun? Thanks a ton!

Ответить