3 - Get JSON with the JavaScript XMLHttpRequest Method - JSON APIs and AJAX - freeCodeCamp Tutorial

Published: 14 June 2020
on channel: Ganesh H
3,815
41

TimeStamps:
00:00 - Challenge
00:34 - Introduction to JSON
01:33 - Processing JSON with Parse and Stringify
03:12 - XMLHTTPRequest
10:38 - Challenge Solution

We look into JSON notation and how to process this. Then we look at XMLHttpRequests and how they can be used to obtain JSON data. We open the request and give it properties, call the send method to send it of, and register a function to the onload property to run, once we have a response.

Link to Challenge : https://www.freecodecamp.org/learn/da...
Concepts:
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
https://www.json.org/json-en.html

parse()
The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string.
https://developer.mozilla.org/en-US/d...

stringify()
The JSON.stringify() method converts a JavaScript object or value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified.
https://developer.mozilla.org/en-US/d...

XMLHttpRequest
XMLHttpRequest (XHR) objects are used to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. XMLHttpRequest is used heavily in AJAX programming.
https://developer.mozilla.org/en-US/d...

XMLHttpRequest.open()
The XMLHttpRequest method open() initializes a newly-created request, or re-initializes an existing one.
https://developer.mozilla.org/en-US/d...

XMLHttpRequest.send()
The XMLHttpRequest method send() sends the request to the server. If the request is asynchronous (which is the default), this method returns as soon as the request is sent and the result is delivered using events. If the request is synchronous, this method doesn't return until the response has arrived.
https://developer.mozilla.org/en-US/d...

XMLHttpRequest.onload
The XMLHttpRequestEventTarget.onload is the function called when an XMLHttpRequest transaction completes successfully.
https://developer.mozilla.org/en-US/d...

XMLHttpRequest.responseText
The read-only XMLHttpRequest property responseText returns the text received from a server following a request being sent.
https://developer.mozilla.org/en-US/d...
————————————————————————————————————
JSON (JavaScript Object Notation) is an open standard file format, and data interchange format, that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and array data types.

Ajax is a set of web development techniques using many web technologies on the client side to create asynchronous web applications. With Ajax, web applications can send and retrieve data from a server asynchronously without interfering with the display and behavior of the existing page.

freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.

Thanks for Watching!


Watch video 3 - Get JSON with the JavaScript XMLHttpRequest Method - JSON APIs and AJAX - freeCodeCamp Tutorial online without registration, duration hours minute second in high quality. This video was added by user Ganesh H 14 June 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,815 once and liked it 41 people.