You are previewing Test-Driven JavaScript Development.

Test-Driven JavaScript Development

Cover of Test-Driven JavaScript Development by Christian Johansen Published by Addison-Wesley Professional

Chapter 13. Streaming Data with Ajax and Comet

In Chapter 12, Abstracting Browser Differences: Ajax, we saw how the XMLHttpRequest object enables web pages to take the role of interactive applications that can both update data on the back-end server by issuing POST requests, as well as incrementally update the page without reloading it using GET requests.

In this chapter we will take a look at technologies used to implement live data streaming between the server and client. This concept was first enabled by Netscape’s Server Push in 1995, and is possible to implement in a variety of ways in today’s browsers under umbrella terms such as Comet, Reverse Ajax, and Ajax Push. We will look into two implementations in this chapter; regular polling ...

The best content for your career. Discover unlimited learning on demand for around $1/day.