Chapter 9. AJAX, wiring, and Comet

 

This chapter covers

  • Lift’s JavaScript abstraction
  • Using AJAX controls
  • AJAX wiring
  • Server-push with CometActors

This chapter covers Lift’s advanced support for AJAX, connected AJAX components, known as wiring, and Comet, or server-push architectures. Creating highly interactive content with Lift is often easier or more intuitive than creating “normal” web applications. Pretty much everything in Lift’s interactive toolkit boils down to writing Scala functions, and AJAX is no different. As Harry Heymann, the lead engineer from Foursquare.com, puts it, “Writing AJAX style code is actually easier in Lift than writing traditional forms... All web programming should work like this.”[1]

1 Harry Heymann, “Foursquare.com & Scala/Lift” (1/11/2010). http://mng.bz/1eX6

Over the past few years particularly, the internet has seen a mass popularization of extremely interactive online experiences. People no longer tolerate green screen experiences and demand rich user interfaces that are slick and responsive. For developers, this creates several different challenges, but it primarily means using AJAX and Comet programming paradigms to create these rich applications.

9.1. AJAX

9.2. Wiring

9.3. Comet

9.4. Summary