Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
AJAX JavaScript XHR and Fetch
Rating: 4.2 out of 5(53 ratings)
3,378 students

AJAX JavaScript XHR and Fetch

Learn how to use AJAX within your web applications, Course covers vanilla JavaScript using XMLHttpRequests and Fetch
Created byLaurence Svekis
Last updated 11/2024
English
English [Auto],

What you'll learn

  • Use AJAX to get JSON data into their web pages
  • Use XHR requests to connect to servers and APIs
  • Use Fetch within web development

Course content

2 sections23 lectures1h 42m total length
  • Introduction to using AJAX XHR and Fetch in JavaScript4:32

    Learn to use XHR and fetch in JavaScript to perform ajax calls and fetch data from web APIs, including random user information and Chuck Norris jokes, using promises.

  • Developer setup environment3:47

    set up your development environment with brackets and Chrome DevTools, and learn to use AJAX, fetch, and the network panel to load random user data and Chuck Norris jokes.

  • Localhost Setup9:31

    Set up localhost to enable ajax calls by running a local server with node and live server, using brackets live preview to avoid file protocol issues.

  • AJAX introduction for Fetch and XHR7:47

    Explore how ajax enables asynchronous data loading with JavaScript, sending http requests, handling responses, and updating the dom without refreshing the page.

  • XHR requests across the web11:52

    Learn how to create and use the ajax xhr request object in JavaScript to fetch data from the web, handle readyState and status codes, parse JSON, and update page content.

  • Exercise Random User XHR option6:23

    Explore advanced XMLHttpRequest options, including on progress and on load, monitor ready state, and fetch random user data via a button, displaying first name, last name, and thumbnail in output.

  • Exercise Random User AJAX Load Data5:38

    Learn to load random user data with AJAX using JSON parsing, display names and pictures, and compare XHR and fetch as you build dynamic web pages.

  • Source Code Ajax Exercise0:16
  • More XHR practice4:26

    practice building an XMLHttpRequest to load a local text file via GET, handle readyState and status 200, and display the response text on the page.

  • XHR Request Data9:34

    Connect to an open chuck norris jokes api and fetch a random joke using ajax and XHR, then parse JSON and display the joke and image on each button click.

  • Joke Exercise AJAX Source Code0:12
  • JavaScript Fetch5:23

    learn to use the fetch API to make ajax calls, handle responses with promises, and retrieve text or json from a web API, while noting its headers support.

  • Source Code Fetch Intro0:14
  • Fetch Promise Response8:22

    Explore fetch and promise handling in JavaScript, comparing formats and chaining promises to parse response text or JSON. Learn to inspect headers and use catch for errors.

  • Fetch Options5:17

    Learn to use fetch options to inspect headers and status codes, log results, and handle errors, while refactoring with fat arrow functions to clean up promise chains and return json.

  • Source Code Fetch Jokes0:13
  • Post with Fetch5:06

    Learn how to post data with fetch, handle json responses, and configure headers and content-type for a form submission, illustrating a server round trip.

  • Fetch Form Submit Data10:34

    Build a form with first name, last name, and company fields, capture input data as an object, prevent default submission, and send it to the server via ajax for processing.

  • Source Code Form Submit0:27
  • Course Overview and summary1:57

    Explore how to practice ajax calls with xhr and fetch, try the included source code, and experiment with public APIs to strengthen your ajax skills and deepen learning.

  • Resources0:01

Requirements

  • JavaScript Experience and HTML and CSS
  • You should have web development Experience

Description

Welcome to our introductory course for using AJAX - Asynchronous JavaScript And XML

AJAX allows web pages to request small chunks of data (such as HTML, XML, JSON, or plain text) and display them only when needed.  This is achieved by using APIs like XMLHttpRequest or Fetch API. These technologies allow web pages to directly handle making HTTP requests for specific resources 

Typically when a user goes to a website the user has to wait for the server to respond with the data.  This is not the case as with AJAX we have the option to load the data when the user is already on the page making the user really happy.

This course covers making AJAX requests using the XMLHttpRequest as well as the newer fetch.   

Use JavaScript to send requests, receive response content and use the response data to output into the html.  JavaScript is at the center of it all connecting the web page content to the server data and doing all the work in between.

Course Covers

  • How to setup a localhost
  • What Fetch and XHR are and how they work
  • How to load an external files into the JavaScript
  • How to connect to web apis and load data
  • Using JavaScript to read response content and make use of it
  • Exercise to build a random user loader
  • Using AJAX to get a txt file content
  • Exercise Getting Random Jokes to output on a website
  • Using Fetch
  • Exercise Posting form data to a server using Fetch
  • Practice AJAX

Source Code is included

Friendly support in the Q&A section

Taught by an instructor with many years real world web development experience ready to answer your questions and help you learn AJAX.

What are you waiting for take the first step start learning AJAX and experience the amazing things YOU can build with AJAX?


Who this course is for:

  • Web developers who want to practice AJAX
  • Anyone who wants to learn more about XHR and Fetch requests
  • JavaScript developers