Chapter 5. Ajax

 

This chapter covers

  • Using Ajax in web applications
  • Creating a simple Ajax example
  • Intergrating YUI into Ajax
  • Integrating Ajax elements into a Zend Framework application

Ajax is a way of using JavaScript to create interactive web pages that send data to and from the server behind the scenes. This means that the user doesn’t see the full page refresh and that a website is more responsive and feels faster to the user. As a result, a web application, such as a web-based email client, behaves more like its desktop cousins. Although it is server-based, Zend Framework’s MVC system, which separates different layers of the application, helps make it easier to add Ajax functionality to your websites.

In this chapter, we will look at what Ajax is and how it is used in web applications. We’ll also examine all the components that make up a simple example in both pure JavaScript and using prebuilt Ajax libraries. We will also integrate Ajax into a Zend Framework application so that we can investigate how Ajax interacts with the MVC system. First, let’s look at exactly what Ajax is.

5.1. Introducing Ajax

5.2. A simple Ajax Example

5.3. Using Ajax Client Libraries

5.4. Using Ajax with Zend Framework

5.5. Integrating into a Zend Framework Application

5.6. Summary