Fetch API & Rendering Data with JavaScript
In this video, we take a look at the browser's built in Fetch API to get some dummy data. We then map over that dummy data to create some HTML with Vanilla JavaScript and render it onto the screen. Key Takeaways From The Video: 3:20 - The Fetch API returns a Promise, so you need to wait for the promise to resolve by using .then() after it. 4:16 - The Fetch API initially return a Response object, which will tell you the status code of the response among other details 5:15 - We need to run the .json() method on the response object to turn the response into more useful data. The .json() method will also return a promise, so we need to chain another .then() onto it. 8:10 - When using the Fetch API, it won't automatically throw all errors. You have to manually check to see if the response object has an "ok" property on it, and throw an error if it's not. This will help you catch things like a 404 error with the response. 11:11 - In order to render our data to the screen, we can use innerHTML or insertAdjacentHTML and insert an HTML string into an existing HTML element. 14:13 - Since the data we get back is an array, we can perform .map() on the array to loop over the data. We then use Template literals to construct our HTML string. 22:10 - With the Fetch API, you can also perform a POST request by adding additional options when making the request. Make sure to add the proper "headers" and use JSON.stringify() in the body of the request. If this video was helpful, please like and subscribe! You can follow me on: Twitter: / hunterhchang https://codebushi.com

Callbacks, Promises, Async Await | JavaScript Fetch API Explained

Learn JSON in 10 Minutes

Next.js Server Side Rendering and getInitialProps

JavaScript Template Literals: JSON to HTML

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

JavaScript DOM Manipulation – Full Course for Beginners

APIs for Beginners - How to use an API (Full Course / Tutorial)

JSON and AJAX Tutorial: With Real Examples

AI Bubble: The data center oversupply crisis is coming | Ed Zitron

How to Load Data Into HTML Tables With The Fetch API in JavaScript

JavaScript Promises In 10 Minutes

1.4: JSON - Working with Data and APIs in JavaScript

God Says:"DON’T IGNORE THIS IMPORTANT LETTER I SENT YOU"/God Message Now/God Message

At Our Son's New House Party, My Wife Whispered, "We Have To Go"—What She Said... | Calm Dad Stories

God Says:"A CALL FROM GOD — OPEN IMMEDIATELY!"/God Message Now/God Message

Fetch API - Javascript In Depth

God Says:"MY CHILD, I NEED TO SEE YOU URGENTLY!"/God Message Now/God Message

Learn JavaScript in 60 Minutes: The Ultimate Beginner Course!

Learn Fetch API In 6 Minutes

