GithubHelp home page GithubHelp logo

steph-wu / bm-first-ajax Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitmakerlabs/first-ajax

0.0 1.0 0.0 27 KB

Bitmaker (Week 6: Lesson 4) - Intro to Ajax

JavaScript 63.97% HTML 36.03%

bm-first-ajax's Introduction

Your First (Several) Asynchronous Requests

See assignment in Alexa.

#0. Setup and Knowledge Check

  1. What HTTP method did your browser use to make the request?
  • GET request.
  1. How many milliseconds did it take your browser to complete it?
  • 117 ms
  1. What HTTP status code did the server return? What does that mean?
  • 200 OK, request was successful.
  1. Look at the "Initiator" and "Type" columns. Was this an xhr/JavaScript/AJAX request or a normal browser request?
  • This was a normal browser request.

#1. Your First AJAX request

What are the values in the "Method" and "Status" columns? Compare these values to Step 0.

  • For the AJAX request, the method is 'GET' and status is 'Finished'. The response to this request from 'First AJAX App' is identical to step 0, with the method as 'GET' and the status as '200'.

What are the values in the "Type" and "Initiator" columns? Compare these values to Step 0.

  • The AJAX request has a type of 'script' and an initiator of 'index.html,' whereas the browser request had initiator 'other' and type 'document'.

#2. Binding to A Click Event

Button created on index.html page to make AJAX request to root path of the server.

#3. Using Information in the Response

The content of the response is "Wow what a ride! I cam all the way from the server!"

#4. When Things Go Wrong...

The new HTTP status code when a request is made to the /pong url is 500 Internal Server Error.

#5. Tidy Up Time...

Add an always callback, and use console.log to output a message like "Hey the request finished!"

#6. All Together Now!

Ensure that each of the done, fail, and always callbacks at least applies a meaningful console.log message.

#7. The Hive Mind

Add button that makes a request to /count.

#8. Sending Data with your Request

Add button that makes a request to /time and sends timezone data.

#9. Receiving HTML in the Response

Add button that makes a HTML request to /a_car and appends the response data into an unordered list.

bm-first-ajax's People

Contributors

mattholtom avatar steph-wu avatar seanlerner avatar natalieblack avatar danielmoniz avatar

Watchers

James Cloos 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.