Quiz

  1. Why is it called Ajax?

    Back when it was invented, people thought that the medium of communication between browsers/servers was going to be XML. (XML looks a lot like HTML, but (1) you get to make up your own tags, and (2) you can describe what makes a valid document.) So, the acronym was Asynchronous JavaScript and XML.

    The first two words are still valid, but nowadays, the medium is almost certainly JSON.

    See Ajax (programming)

  2. I was wondering if we could go over Question 2? I was a little confused by the wording of the question.

    Sure. Here is the question, with the correct answer:

    Put the steps of Ajax in order
    
    1.  Browser sends request
    2.  Server receives request
    3.  Browser receives response
    4.  Page is updated
    

    That's how our "likes" operation, and all other Ajax interactions happen.

  3. I'm still confused on when we would use Ajax vs Classic.

    Nowadays, almost every client supports JavaScript and Ajax, even assistive technologies for the blind. But maybe not every client.

    For example, a web crawler written in Python might find your page, and see the buttons, but not execute the JS that handles clicks on those buttons. But it might see forms that could be submitted.

    So, there are some situations where the classic approach would work, but the Ajax approach would not.

    The idea of progressive enhancement is to do both: supply the Classic as a lowest-common-denominator, and provide the Ajax approach for a superior experience.