Fetch API Explained - Working with Data & APIs in JavaScript

  Рет қаралды 35,661

codeSTACKr

codeSTACKr

Күн бұрын

Пікірлер: 49
@codeSTACKr
@codeSTACKr 5 жыл бұрын
Correction: I misspoke that fetch is part of JavaScript ES6. It is an API that was introduced about the same time as ES6 by WHATWG. Comparability is currently at 92% across browsers. Thanks for all the support!! Next up watch: Async JavaScript - Callbacks, Promises, Async/Await - (2019) kzbin.info/www/bejne/fGnbcoGOjpWel7c 📚 My Favorite Web Design Books 📚 Web Design with HTML, CSS, JavaScript and jQuery Set by Jon Duckett (paid link) amzn.to/2JaiCL8
@chaseezra5450
@chaseezra5450 3 жыл бұрын
A trick: watch movies at kaldrostream. Been using them for watching a lot of movies during the lockdown.
@christopherfranklin9822
@christopherfranklin9822 3 жыл бұрын
@Chase Ezra Yup, been using KaldroStream for years myself :)
@alibarznji2000
@alibarznji2000 4 жыл бұрын
your channel is outrageously underrated. Thank you for these amazing contents
@codeSTACKr
@codeSTACKr 4 жыл бұрын
I appreciate that!
@rafaelcalderon6658
@rafaelcalderon6658 4 жыл бұрын
Simple, but not basic. This kind of tutorial are the best. Thank you
@codeSTACKr
@codeSTACKr 4 жыл бұрын
You're welcome!
@Webnoob
@Webnoob 5 жыл бұрын
Amazing hand-on tutorial, straight to the point. Really enjoyed watching that. We can learn something about the Fetch API, Promises and Async and Await. Keep it going. 🙂👍
@codeSTACKr
@codeSTACKr 5 жыл бұрын
Thanks!
@valentina2375
@valentina2375 2 жыл бұрын
1:55 i tried my own json but i get a " Fetch API cannot load file:///Users/valentina/Desktop/javascript/products.json. URL scheme "file" is not supported. '' im also using Chrome
@tanercoder1915
@tanercoder1915 4 жыл бұрын
This was a very easy to understand tut. Thanks!
@codeSTACKr
@codeSTACKr 4 жыл бұрын
Glad it was helpful!
@Hunter-eu2jg
@Hunter-eu2jg 5 жыл бұрын
Great Video. You should try to fold this into a full fledged app or blog tutorial built from the ground up.
@codeSTACKr
@codeSTACKr 5 жыл бұрын
Great minds think alike.. It's on the way! 😁 Thanks for the support!
@giancarloandrebravoabanto7091
@giancarloandrebravoabanto7091 2 жыл бұрын
what do they mean when they say: get latest updates from the server using fetch ?
@andresramirez4469
@andresramirez4469 2 жыл бұрын
i am trying to figure code to write for using fetch api on a json file and form validation
@taiwodamilola8636
@taiwodamilola8636 4 жыл бұрын
how do i use what was returned from fetch (body) outside the fetch block..?
@pjmclenon
@pjmclenon 3 жыл бұрын
hello for me the catch block for errors is useless because it doesnt tell which actual line the error is; how are you suppose to find the error? Lisa
@turnerkirk1920
@turnerkirk1920 4 жыл бұрын
Love your Tutorials! I'm curious why you manually created the "i" variable and incremented it with "i++" to start at 1 instead of using the index that is given to you as the second argument in the forEach() method? (i.e. posts.forEach( (post, i) => { if (i < 9) //code block }); Is it better to do it manually for some reason? Or just personal preference? (at timestamp 6:04)
@codeSTACKr
@codeSTACKr 4 жыл бұрын
Just to demonstrate the loop. I would normally use the index from forEach
@turnerkirk1920
@turnerkirk1920 4 жыл бұрын
@@codeSTACKr ok cool thanks for clarifying! Just making sure I wasn't missing something weird about the scope messing with indexes or something. I'm still learning what's what.
@DuyTran-ss4lu
@DuyTran-ss4lu 5 жыл бұрын
Great teaching method and professional approach
@codeSTACKr
@codeSTACKr 5 жыл бұрын
Thank you!
@emredemirel9725
@emredemirel9725 5 жыл бұрын
That's a perfect explanation of how to do API calls. Can you make a video about how to use private APIs with fetch and promises? For example how can I get and post stuff to my Firebase.
@codeSTACKr
@codeSTACKr 5 жыл бұрын
For sure.. I'll at it to my list 😁 Thanks for watching!
@rahulsriram6295
@rahulsriram6295 4 жыл бұрын
I'm unable to use tagged template literals for creating HTML elements and assign them as iinerHTML of a div, for images. Normal posts, text, JSON everything is showing up in the DOM, but images arent. How do I do it? let res = await fetch('unsplash.it/600/400'); let blob = await res.blob(); let output = ` `; document.getElementById('output').innerHTML = output; All this is wrapped in an async function
@FeelingLike
@FeelingLike Жыл бұрын
It gives me an error when i tried this code, should I run npm or something like this before hand?
@kenturnbull9679
@kenturnbull9679 4 жыл бұрын
If I am understanding what I just watched correctly, does fetch replaces the need for PHP and PDO, as well as AJAX, for moving data to and from a mySQL database.
@shubham121gupta
@shubham121gupta 4 жыл бұрын
how could we make each post clickable and when clicked it should fetch using id of that post and return further details of that post, plz help i despertly need that in one of my project
@codeSTACKr
@codeSTACKr 4 жыл бұрын
It would be a simple event listener for click which would pass the id to the API which would return those details.
@deeptimonga7375
@deeptimonga7375 4 жыл бұрын
Hi codeSTACKr, I am getting document.querySelector('#post-template') is null. Can you please help me
@pratiksuryawanshi8282
@pratiksuryawanshi8282 4 жыл бұрын
How to return the data ?? I am getting the undefined value
@EyeIn_The_Sky
@EyeIn_The_Sky Жыл бұрын
How the hell did you manage to call a local file using the "fetch" API? Apparently it is not supported "yet", I tried for ages and kept getting "ERR_INVALID_URL"? Did you somehow host it on port 5500 on a live web server?
@sylwesterjot921
@sylwesterjot921 4 жыл бұрын
Very informative lesson Thank you!
@ProgrammingwithPeter
@ProgrammingwithPeter 5 жыл бұрын
Great video, still like to use something like axios over this because fetch with internet explorer and safari doesn't get too well.
@codeSTACKr
@codeSTACKr 5 жыл бұрын
For sure.. I actually totally forgot to mention compatibility. It's getting there at 92% compatibility but definitely think about your audience. Thanks for the feedback!
@ProgrammingwithPeter
@ProgrammingwithPeter 5 жыл бұрын
@@codeSTACKr Your video is great nonetheless. It's the responsibility of the one that use it to check compatibility, depending on the project requirements.
@navdeepdhamu1945
@navdeepdhamu1945 5 жыл бұрын
God! This guy must be from web dev heaven!! Explained nicely. Please make a video on the This key word in real world usage?? I still don't understand that sh*t?
@kubataiupov1245
@kubataiupov1245 2 жыл бұрын
thanks for nice videos.
@kenturnbull9679
@kenturnbull9679 4 жыл бұрын
This is great. The sort of stuff I need. How about a more advanced version of the template example with multiple templates and fetching.
@codeSTACKr
@codeSTACKr 4 жыл бұрын
More advanced stuff on the way..
@kenturnbull9679
@kenturnbull9679 4 жыл бұрын
@@codeSTACKr This await stuff combined with the fetch has given me sooooo many new ideas especially since I deal with sql databases extensively. Question becomes what is the best way to pass the data around. Using PDO objects now.
@alibarznji2000
@alibarznji2000 4 жыл бұрын
it would be really helpful if you could do a tutorial on how to do this with an owl carousel
@mikeviverette5867
@mikeviverette5867 5 жыл бұрын
Awesome video!
@codeSTACKr
@codeSTACKr 5 жыл бұрын
Thanks for your support!
@suriyaas4877
@suriyaas4877 3 жыл бұрын
very helpful
@muhammadebadurrahman
@muhammadebadurrahman 2 жыл бұрын
john doe and jane doe could name their son johnny doe :P so they could keep their family naming convention LOL
@soltiscd
@soltiscd 4 жыл бұрын
Subscribed.
@Bertie211
@Bertie211 4 жыл бұрын
Confusing I think it’s not for me
Asynchronous JavaScript Tutorial #9 - The Fetch API
7:28
Net Ninja
Рет қаралды 110 М.
Learn Fetch API In 6 Minutes
6:35
Web Dev Simplified
Рет қаралды 1,3 МЛН
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН
POST Form Data as JSON with Fetch API in JavaScript
9:25
ByteGrad
Рет қаралды 68 М.
Sending JavaScript Http Requests with Axios
11:50
Academind
Рет қаралды 176 М.
1.1: fetch() - Working With Data & APIs in JavaScript
15:39
The Coding Train
Рет қаралды 456 М.
How to use a Public API | Using a Public API with Python
14:01
Alex The Analyst
Рет қаралды 50 М.
MVC Explained in 8 Minutes
8:09
codeSTACKr
Рет қаралды 27 М.
HTTP vs. HTTPS: How SSL/TLS Encryption Works
8:12
Ahrefs
Рет қаралды 41 М.
APIs for Beginners - How to use an API (Full Course / Tutorial)
2:19:33
freeCodeCamp.org
Рет қаралды 4,4 МЛН
GET Data from API & Display in HTML with JavaScript Fetch API
5:50
Learn JSON not Jason in 10 Minutes
15:24
codeSTACKr
Рет қаралды 20 М.
CSS Crash Course In 30 Minutes
39:47
codeSTACKr
Рет қаралды 105 М.
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН