Chapter 5. Communicating with the Server

This chapter discusses how to communicate with the server. To demonstrate this, a simple test server is written in Node.js, which is a server-side JavaScript execution environment. After that, various recipes show how to get JSON, HTML, XML, and JSONP from the server by using AJAX methods and functions. This chapter pays a lot of attention to error handling to assure the quality of the end result.

Recipe: Setting Up an Example Server in Node.js

To test the AJAX examples, you need a server. For the examples, it does not matter whether the server is written in PHP, Python, Ruby, Erlang, Dart, Go, .Net, or Java. Keep in mind, of course, that all servers take some setup time.

Because jQuery is JavaScript, ...

Get jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples 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.