Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Step 1 : Fetch the quotes The fetchQuotes ( ) function in quote.js is called with the selected topic and count when the Fetch Quotes
Step : Fetch the quotes
The fetchQuotes function in quote.js is called with the selected topic and count when the Fetch Quotes button is clicked. Currently, fetchQuotes calls showAnonymousQuotes to display example quotes in an ordered list.
Modify fetchQuotes to use the XMLHttpRequest object to request quotes from the quote web API. Set the XMLHttpRequest's responseType to expect a JSON response. Register responseReceivedHandler as the XMLHttpRequest's load event handler.
Step : Display the quotes
Implement responseReceivedHandler to extract the quotes from the XMLHttpRequest response and display the quotes in an ordered list. Each quote should be followed by a space, a dash, a space, and the source. You may find it helpful to repurpose the code in showAnonymousQuotes to create the quote list.
Ex: If the user chooses "love" and and clicks Fetch Quotes, responseReceivedHandler should place the returned quotes in an ordered list inside the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started