Vets-Who-Code/js-web-path-fitzcodes

Asynchronous Javascript

Opened this issue · 0 comments

Task Demonstrate the ability to build asynchronous Javascript applications
Conditions vscode Live Server running and serving an HTML webpage with Javascript
Standards Use Javascript to:
  • Create an HTML button that on click that uses a JS Promise to wait one second and then sends a fetch request to GET data from an external API
  • Once the request is sent show that the request is loading
  • If the request succeeds show the contents of the received data to the webpage
  • If the request fails show the error status code and message

Notes

  • You'll get a list of data by sending a Fetch (AJAX) GET request to https://swapi.dev/api/people/
  • If you're getting CORS errors ensure you're navigating to the web page served by vscode Live Server

References