Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This chapter describes four techniques for client-side JavaScript
networking. The first, XMLHttpRequest, is
well-known and widely-used in the “Ajax” application architecture. This API
is by far the most important of the four, and the bulk of the chapter is
devoted to it. The chapter also demonstrates the JSONP technique for
Ajax-style networking with the <script> tag, as well as “server push” or “Comet” style networking
with the new EventSource API, and bidirectional socket-style networking with
WebSockets.