AJAX / Fetch API Crash Course - #90

Published: June 1, 2022

Estimated Reading Time
1 minutes
Video Duration
33:41
Get Notified of New Videos and Courses

Have you ever had to decide between Fetch API and AJAX? When you are needing to get data from a remote API or PHP file, you have a few options within JavaScript. In this tutorial, I show you how to do it both ways. You can use jQuery for AJAX or vanilla JS for Fetch API.

AJAX has been tried and tested for years within jQuery and at one point was the go-to method. With Vanilla JS making a considerable comeback, new options like the built-it Fetch API are used more often. This is mostly due to its ease of use and since it is built into JavaScript, you no longer need a framework or library to use it.

00:00 Intro

01:21 Setup Our File Structure

02:56 Create Our index.html

06:28 Building Our jQuery AJAX Request

10:33 Building Our PHP File JSON (insert API if needed)

15:25 Formatting JSON AJAX Responses

20:04 Building Our Fetch API Request

27:06 Formatting JSON Fetch API Responses

30:19 Finishing Up

32:54 Course Announcement

Download tutorial files here: https://github.com/thedevdrawer/php-ajax-fetch

⭐ If you would like to buy me a coffee because I created something that helped you, it would be much appreciated! : https://www.buymeacoffee.com/devdrawer

⭐ Join this channel to get access to perks:

https://www.youtube.com/channel/UCcr8eSk5xCfn3AbYy8WOWzg/join

⭐ Become a Patreon to show support and get exclusive access to content: https://www.patreon.com/devdrawer



Failed to load data. Please try again later.

I Have Merch!

Step Up Your Engineering Wardrobe

Dress like the software engineer you are and deck yourself out with custom apparel and sticks I would wear myself.

Check out my merch store for t-shirts, hoodies, stickers, and more. Show off your love for coding and support the channel at the same time!
I Have Merch!
You found the Easter Egg