O'Reilly logo

Learning JavaScript: A Hands-On Guide to the Fundamentals of Modern JavaScript by Tim Wright

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8. Communicating with the Server Through Ajax

In this chapter, we take a step into the world of Ajax. We extend code from previous chapters and take that codebase to the next level by interlacing it with a server communication layer to retrieve the data. More specifically, we take the JSON object you’ve been working with and move it to an external data file. Then we pull it in with a combination of user events (just like before) and Ajax calls to create another layer of separation where the data source is external to our normal stack of structure, presentation, and behavior. The data layer can be in almost any form from JSON (which is what we’re using) to a fully functional database.

In previous chapters, we mentioned Ajax briefly, but in this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required