concept AJAX in category lift

This is an excerpt from Manning's book Lift in Action: The Simply Functional Web Framework for Scala.
The actual mechanism for updating the view isn’t important for this discussion (full page load, AJAX, or some other method). Rather, the model responds and the response is passed to the view via the snippet.
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]
Currently, this form will force a hard refresh every time it’s submitted. This is functional, but it’s somewhat clunky. Fortunately Lift supports AJAX in LiftScreen right out of the box, and enabling this is a simple two-step process.
First, in the invoking markup, you need to indicate to Lift that this form will use AJAX:
<lift:LiftScreenAJAXExample ajax="true" />Specifically note the addition of the ajax="true" parameter. This is the simplest way to add AJAX to an existing form, but you can also override the defaultToAjax_? method in the screen definition if you’d prefer to keep all the configuration in Scala code.
Lift has several different ways to interact with forms and AJAX, and as you saw in the previous section, you can quite easily configure Lift to create an AJAX form by using SHtml. SHtml contains many useful methods and should be your main port of call for all of the out-of-the-box AJAX functionality.