Day 6: More Ajax

Tuesday, June 7, 2016

Topics

Ajax

CDNs

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

Presentations

Presentations have been converted from their original format to play in web browsers.

Projects

  • jMutants: morning (with working edit feature) | afternoon (without edit, but with mutant name, _realname, and power)
$.get({
  url: 'https://api.nasa.gov/planetary/apod',
  data: {
    API_KEY: 'DEMO_KEY',
    date: '2016-06-07'
  }
  success: function(data) {
    $(document.body).prepend('<img src="' + data.hdurl + '">');
  }
});

If you plan to do much with the NASA APIs, you’ll need to sign up for your own API_KEY, which is free.

Homework

Try to get further with yesterday’s homework.

Talk to the Mutant School API!

Baseline Goal

  • Start a new project (or fork JSON People and work from there) that loads all Mutants from the API.
  • When a new record is added to your app, create a new Mutant record by POSTing to the API.

Bonus Credit

Add a button to delete individual mutants from the API.

Mega Bonus Credit

Update existing mutant records.

Super Mega Bonus Credit

Integrate the Mutant API with MegaRoster.

Super Mega Bonus Credit Hyper Fighting

Add Pokémon, Star Wars characters, or something else with an existing API.