Question: In this project, we will build a web - based E commerce application that helps users to register, sign in and view information of available
In this project, we will build a webbased E commerce application that helps users to register, sign in and view information of available cuisines, categories and restaurants. The application should have the following features :
Cuisines, Categories and Restaurants Data Fetch: You have to write an advanced java script code for fetchData
function.
This is a common function to fetch data from an API.
This function is called by the loadContent function to load cuisines, categories and restaurants data.
The loadContent function is called on the onload event of the index.html page. This function is already implemented
The fetchData function is called thrice by the loadContent function to fetch cuisine data, category data and restaurants data respectively.
The above mentioned URL endpoints are already mentioned in the loadContent
function.
The fetchData function takes two arguments: URL endpoints and the respective list elements from the index.html page.
The function is declared as async as its fetching data asynchronously.
It also handles errors in case the data could not be fetched.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
