13 Ajax
In the last chapter, you used the browser’s built-in validation to ensure that the user entered data that fit CoffeeRun’s parameters. After doing those checks, you can feel confident about sending that data to the server.
At the moment, the FormHandler.prototype.addSubmitHandler method calls the event object’s preventDefault method to keep the browser from sending a request to the server. Normally, the server sends back a response that causes the page to reload. Instead, you are extracting the data that the user enters into the form and updating the form and the checklist with JavaScript.
In this chapter, you will create a RemoteDataStore module that sends a request to the server and handles the response (Figure 13.1
Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.