Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

382 CHAPTER 8 Websites and services


Lesson review


Answer the following questions to test your knowledge of the information in this lesson. You
can find the answers to these questions and explanations of why each answer choice is correct
or incorrect in the “Answers” section at the end of this chapter.


  1. You want to create a REST service for your internal web service and use the HTTP verbs
    that match CRUD operations. You know the browser your users will be using is compat-
    ible, and the firewall will not be a problem. What are the HTTP verbs that match with
    CRUD (in order)?
    A. CREATE, POST, GET, DELETE
    B. GET, RETRIEVE, UPDATE, DELETE
    C. PUT, GET, POST, DELETE
    D. POST, GET, UPDATE, DELETE

  2. What is the primary object used to make an asynchronous AJAX call that returns a
    JSON result?
    A. XMLHttpRequest
    B. AjaxRequest
    C. JsonResponse
    D. AjaxAsync

  3. You want to use jQuery to make an AJAX call that will use the HTTP POST method.
    Which jQuery method can you use?
    A. $.post()
    B. $.getJSON()
    C. $.get()
    D. $.param()


Practice exercises


If you encounter a problem completing any of these exercises, the completed projects can be
installed from the Practice Exercises folder that is provided with the companion content.

Exercise 1: Create a website to receive data


In this exercise, you apply your website, web service, and Node.js knowledge by creating a
website that receives postback data from the ContactUs.html page of the WebCalculator
project that you modified in the previous chapter. You create the website in a folder separate
from your WebCalculator solution and then copy the WebCalculator project to a subdirec-
tory of the website. In this scenario, Node.js can still serve pages from the WebCalculator
Free download pdf