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
@chaseezra54503 жыл бұрын
A trick: watch movies at kaldrostream. Been using them for watching a lot of movies during the lockdown.
@christopherfranklin98223 жыл бұрын
@Chase Ezra Yup, been using KaldroStream for years myself :)
@alibarznji20004 жыл бұрын
your channel is outrageously underrated. Thank you for these amazing contents
@codeSTACKr4 жыл бұрын
I appreciate that!
@rafaelcalderon66584 жыл бұрын
Simple, but not basic. This kind of tutorial are the best. Thank you
@codeSTACKr4 жыл бұрын
You're welcome!
@Webnoob5 жыл бұрын
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. 🙂👍
@codeSTACKr5 жыл бұрын
Thanks!
@valentina23752 жыл бұрын
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
@tanercoder19154 жыл бұрын
This was a very easy to understand tut. Thanks!
@codeSTACKr4 жыл бұрын
Glad it was helpful!
@Hunter-eu2jg5 жыл бұрын
Great Video. You should try to fold this into a full fledged app or blog tutorial built from the ground up.
@codeSTACKr5 жыл бұрын
Great minds think alike.. It's on the way! 😁 Thanks for the support!
@giancarloandrebravoabanto70912 жыл бұрын
what do they mean when they say: get latest updates from the server using fetch ?
@andresramirez44692 жыл бұрын
i am trying to figure code to write for using fetch api on a json file and form validation
@taiwodamilola86364 жыл бұрын
how do i use what was returned from fetch (body) outside the fetch block..?
@pjmclenon3 жыл бұрын
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
@turnerkirk19204 жыл бұрын
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)
@codeSTACKr4 жыл бұрын
Just to demonstrate the loop. I would normally use the index from forEach
@turnerkirk19204 жыл бұрын
@@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-ss4lu5 жыл бұрын
Great teaching method and professional approach
@codeSTACKr5 жыл бұрын
Thank you!
@emredemirel97255 жыл бұрын
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.
@codeSTACKr5 жыл бұрын
For sure.. I'll at it to my list 😁 Thanks for watching!
@rahulsriram62954 жыл бұрын
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 Жыл бұрын
It gives me an error when i tried this code, should I run npm or something like this before hand?
@kenturnbull96794 жыл бұрын
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.
@shubham121gupta4 жыл бұрын
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
@codeSTACKr4 жыл бұрын
It would be a simple event listener for click which would pass the id to the API which would return those details.
@deeptimonga73754 жыл бұрын
Hi codeSTACKr, I am getting document.querySelector('#post-template') is null. Can you please help me
@pratiksuryawanshi82824 жыл бұрын
How to return the data ?? I am getting the undefined value
@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?
@sylwesterjot9214 жыл бұрын
Very informative lesson Thank you!
@ProgrammingwithPeter5 жыл бұрын
Great video, still like to use something like axios over this because fetch with internet explorer and safari doesn't get too well.
@codeSTACKr5 жыл бұрын
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!
@ProgrammingwithPeter5 жыл бұрын
@@codeSTACKr Your video is great nonetheless. It's the responsibility of the one that use it to check compatibility, depending on the project requirements.
@navdeepdhamu19455 жыл бұрын
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?
@kubataiupov12452 жыл бұрын
thanks for nice videos.
@kenturnbull96794 жыл бұрын
This is great. The sort of stuff I need. How about a more advanced version of the template example with multiple templates and fetching.
@codeSTACKr4 жыл бұрын
More advanced stuff on the way..
@kenturnbull96794 жыл бұрын
@@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.
@alibarznji20004 жыл бұрын
it would be really helpful if you could do a tutorial on how to do this with an owl carousel
@mikeviverette58675 жыл бұрын
Awesome video!
@codeSTACKr5 жыл бұрын
Thanks for your support!
@suriyaas48773 жыл бұрын
very helpful
@muhammadebadurrahman2 жыл бұрын
john doe and jane doe could name their son johnny doe :P so they could keep their family naming convention LOL