Giter VIP home page Giter VIP logo

the-async-force-ep-1's Introduction

The-Async-Force-Ep-1

An async Exercise using client side XHR accessing the swapi API at https://swapi.co

Excercise

Remember to commit after each step.

  1. Make a /js folder and create an app.js file in it.

  2. In the index.html file, load app.js via script tags.

  3. Use live-server to serve up the files to your browser.

  4. Construct your XHR requests in the app.js file to the following endpoints and retrieve the data specified.

    the instructions below will mention ids and classes from index.html, study that document

  5. Get a Person object from the SWAPI, https://swapi.co/api/people/4/

    • fill in person4Name with the value of Person's name
    • fill in person4HomeWorld with the value of Person's homeworld (name)
  6. Get a Person object from the SWAPI, https://swapi.co/api/people/14/

    • fill in person14Name with the value of Person's name
    • fill in person14Species with the value of Person's (first) species (name)
  7. Get a list of all the films from the SWAPI, https://swapi.co/api/films/

    • fill in filmList with a new <li> element for each film
      • fill in each film's filmTitle with the title of the film
      • create a new <li> in this film's filmPlanets for each planet that appeared in this film
        • fill in each planetTitle with the name of the planet

Hints

  1. Slides on Async HTTP Request with XHR: http://slides.com/sgnl/xhr#/
  2. Documentation on 'XMLHttpRequest' method: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest
  3. Remember that this is a client side excercise which means that all the code will be executed via the browser's javascript runtime, which means that our global context is the 'window' object. Go ahead and type in 'window' in the browser console to inspect the methods on the 'window' object. In there you will find a method named 'XMLHttpRequest' which you will be using for this excercise.

the-async-force-ep-1's People

Contributors

lorecrafting avatar theremix avatar steveninouye avatar

Watchers

James Cloos avatar May Chen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.