Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING HTML/JAVASCRIPT The url 'https://jsonplaceholder.typicode.com/users' has a list of users in JSON format. Please type the url in your browser to see the data. This

USING HTML/JAVASCRIPT

The url 'https://jsonplaceholder.typicode.com/users' has a list of users in JSON format. Please type the url in your browser to see the data. This assignment asks you to use two APIs to retrieve data from the url. The first API is the old XMLHttpRequest and its callback syntax. The second is the new fetch method and its promise syntax. When access your web page, just display the following two results (in italic blue format) format the results whatever you want. Tips: use Chrome dev tools to debug / test your code interactively.

Use the old XMLHttpRequest method and its callback syntax to retrieve the data from the above url and display the list of user emails the results are sorted by alphabet order.

User emails from XMLHttpRequest:

["Chaim_McDermott@dana.io", "Julianne.OConner@kory.org", "Karley_Dach@jasper.info", "Lucio_Hettinger@annie.ca", "Nathan@yesenia.net", "Rey.Padberg@karina.biz", "Shanna@melissa.tv", "Sherwood@rosamond.me", "Sincere@april.biz", "Telly.Hoeger@billy.biz"]

Use the new fetch method and its promise syntax to display the list of users usernames. The result is sorted by the username length shortest first.

User usernames from fetch:

["Bret", "Kamren", "Samantha", "Karianne", "Delphine", "Antonette", "Elwyn.Skiles", "Maxime_Nienow", "Moriah.Stanton", "Leopoldo_Corkery"]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions