Skip to content

Instantly share code, notes, and snippets.

@rapala61
Last active May 7, 2016 21:46
Show Gist options
  • Select an option

  • Save rapala61/11cb36e387fc45ad8121 to your computer and use it in GitHub Desktop.

Select an option

Save rapala61/11cb36e387fc45ad8121 to your computer and use it in GitHub Desktop.
AJAX lab with the doughnut API.

Practicing AJAX - (60m)

Introduction

You're about to write a lot of AJAX-backed JavaScript – using jQuery – that will complete our little Doughnut Shop app.

Make use of the fantastic and delicious https://api.doughnuts.ga. Your task is to use your JS skills to list out all the doughnuts in our database and get our form working so we can add more.

Note: Keep in mind, this API doesn't persist (so that other students can use it, too), but it does act like it. When you create a new doughnut, it'll show you results as if that doughnut was persisted. Make use of it!

Exercise

Requirements

  • Implement a jQuery AJAX client for a simple REST service
  • Create a new API resource (a doughnut) from your client

Bonus

  • Update an existing API resource (a doughnut) from your client with new data
  • Destroy an existing API resource (a doughnut) from your client

Starter Code

You'll find the starter code in the lab-starter-code folder in your repo. It's a basic index and some styling, along with an empty js/scripts.js.

Deliverable

Make a list of existing doughnuts underneath the form, make the form work, and then, build your app to add to the list of donuts - using the information from newly created donuts - without refreshing the page.

Additional Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment