Vanilla JavaScript: Ajax and Fetch
Offered By: LinkedIn Learning
Course Description
Overview
Ajax is the backbone of high-performance web apps. Learn how to use vanilla JavaScript, Ajax, and APIs like Fetch and XHR to request and handle data and modify webpage content.
Ajax is a building block of the modern web. Ajax helps you communicate between your app and the server, and incorporate new content without reloading webpagesâresulting in more interactive and high-performance apps. This course introduces both modern and legacy approaches for requesting and handling data and modifying webpage content with Ajax and vanilla JavaScript. JS expert Sasha Vodnik shows how to work with the Fetch and XMLHttpRequest (XHR) APIs, so you can see how Ajax is implemented in different codebases. He also shows how to optimize Ajax requests and responses within the browser, modify webpage content through the DOM, and handle any errors that result. Plus, learn how to move your API keys out of front end code and onto a proxy server to keep them secure.
Ajax is a building block of the modern web. Ajax helps you communicate between your app and the server, and incorporate new content without reloading webpagesâresulting in more interactive and high-performance apps. This course introduces both modern and legacy approaches for requesting and handling data and modifying webpage content with Ajax and vanilla JavaScript. JS expert Sasha Vodnik shows how to work with the Fetch and XMLHttpRequest (XHR) APIs, so you can see how Ajax is implemented in different codebases. He also shows how to optimize Ajax requests and responses within the browser, modify webpage content through the DOM, and handle any errors that result. Plus, learn how to move your API keys out of front end code and onto a proxy server to keep them secure.
Syllabus
Introduction
- Creating and working with API requests
- Setting up your environment
- What is Ajax?
- Understand asynchronous program flow
- Get an API key
- Research and create an Ajax request URL
- Create an XHR request
- Test an XHR request
- Handle XHR success and failure
- Challenge: Build an XHR request
- Solution: Build an XHR request
- What is the DOM?
- Select elements with vanilla JavaScript
- Request data in response to an event
- Add an event listener
- Work with JSON data
- Modify form values with vanilla JavaScript
- Modify element content with vanilla JavaScript
- Challenge: Modify the DOM
- Solution: Modify the DOM
- Understand the Fetch API
- Create a fetch request
- Handle basic fetch errors
- Customize a fetch request
- Structure Ajax requests for performance
- View requests and responses in the browser
- Work with authorization errors
- Work with malformed requests
- Work with errors in Fetch
- Provide error fallbacks
- Challenge: Fix an Ajax request
- Solution: Fix an Ajax request
- Why are proxy servers necessary?
- Tools: Git, GitHub, and Heroku
- Set up an app on Heroku
- Configure proxy options
- Deploy and test a proxy
- Configure proxy security
- Challenge: Customize code for an Ajax proxy
- Solution: Customize code for an Ajax proxy
- Next steps
Taught by
Sasha Vodnik
Related Courses
Programming LanguagesUniversity of Virginia via Udacity Building a Basic Website
University of Massachusetts Amherst via Independent iDESWEB, Introducción al desarrollo web
Miríadax Web Engineering II: Developing Mobile HTML5 Apps
Technische Hochschule Mittelhessen via iversity Web Application Architectures
University of New Mexico via Coursera