Ajax for Web Application Developers

Book description

Reusable components and patterns for Ajax-driven applications

Ajax is one of the latest and greatest ways to improve users’ online experience and create new and innovative web functionality. By allowing specific parts of a web page to be displayed without refreshing the entire page, Ajax significantly enhances the experience of web applications. It also lets web developers create intuitive and innovative interaction processes.

Ajax for Web Application Developers provides the in-depth working knowledge of Ajax that web developers need to take their web applications to the next level. The book shows how to create an Ajax-driven web application from an object-oriented perspective, and it includes discussion of several useful Ajax design patterns.

This detailed guide covers the creation of connections to a MySQL database with PHP 5 via a custom Ajax engine and shows how to gracefully format the response with CSS, JavaScript, and XHTML while keeping the data tightly secure. It also covers the use of four custom Ajax-enabled components in an application and how to create each of them from scratch.

The final section of the book combines the individual code examples and techniques from earlier chapters of the book into one larger, Ajax-driven application—an internal web mail application that can be used in any user-based application, such as a community-based web application. Readers will learn not only how to create and use their own reusable Ajax components in this application

but also how to connect their components to any future Ajax applications that they might build.

Web Development/Ajax/JavaScript 

Table of contents

  1. Copyright
  2. About the Author
  3. Acknowledgments
  4. We Want to Hear from You!
  5. Reader Services
  6. Introduction
    1. An Introduction to the Book Samples
  7. Getting Started
    1. Introduction to Ajax
      1. The XML DOM
      2. Measuring the Benefits
    2. The Request
      1. An In-Depth Look at XMLHttpRequest
      2. Creating the Object
      3. Asynchronous Data Transfers
      4. The Ready State
      5. HTTP Status Codes and Headers
    3. The Response
      1. XML
      2. JSON
    4. Rendering the Response with XHTML and CSS
      1. XHTML
      2. CSS
  8. Creating and Using the JavaScript Engine
    1. Object-Oriented JavaScript
      1. Object-Oriented Approaches
      2. Using the new Operator
      3. Literal Notation
      4. Associative Arrays
      5. JScript.NET
      6. Object Constructors
      7. Prototypes
        1. Creating Properties
    2. Creating the Engine
      1. Creating a Custom Ajax Wrapper
        1. Making Requests
      2. Creating an Ajax Updater
    3. Using the Engine
      1. Getting Started
      2. Making a Request
      3. Engine Methods and Properties
    4. Debugging
      1. The JavaScript onerror Event
      2. responseText
      3. IE Developer Toolbar
        1. Installing the Plug-in
      4. Safari Enhancer
        1. Installing Safari Enhancer
      5. FireBug
        1. Levels of Logging
        2. Spying on Ajax
    5. Extending the Engine
      1. Creating a Utilities Object
      2. Handling Status Codes with an HTTP Object
  9. Creating Reusable Components
    1. Accordion
      1. Getting Started
        1. Requesting the XML
      2. Creating the Accordion Object
      3. Panel Functionality and Data Display
        1. Creating the CSS
    2. Tree View
      1. Structuring the Data
      2. Handling the Response
      3. Rendering the GUI
        1. Adding Style to the Component
    3. Client-Side Validation
      1. Getting Started
      2. Creating a Validation Object
      3. The Server Side
    4. Data Grid
      1. Getting Started
      2. Creating a DataGrid Object
      3. Displaying the Data
  10. Ajax Patterns
    1. Singleton Pattern
      1. An Overview of the Singleton Pattern
      2. Creating an Object Using the Singleton Pattern
      3. Using the Singleton Object
    2. Model View Controller
      1. An Overview of the Pattern
      2. Creating the Pattern
      3. Using the Pattern
    3. The Observer Pattern
      1. Pattern Overview
      2. Creating an Error-Handling Object
        1. Unregister Observers
      3. Using the Error-Handling Object
    4. Data Reflection Pattern
      1. An Overview
      2. Creating the Pattern
    5. Interaction Patterns
      1. Creating a History with Cookies
        1. Creating and Displaying the XML
      2. Drag and Drop
    6. Usability Patterns
      1. Handling Feedback, Errors, and Warnings
  11. Server-Side Interaction
    1. Understanding Ajax Database Interaction
      1. Connecting with PHP
        1. Making the Requests
    2. Interacting with a Database: The Server-Side
      1. Connecting to ASP.NET
      2. Connecting to ColdFusion
    3. Advanced Ajax Database Interaction
      1. Bulk Updates
      2. Server-Side XML and JSON
        1. XML
  12. Finishing Touches
    1. Securing Your Application
      1. Security Holes
      2. Password-Protecting Ajax Requests
      3. Verifying Passwords on the Server-Side
    2. Best Practices
      1. Using the Engine
        1. Design Patterns
        2. Error and Feedback Handling

Product information

  • Title: Ajax for Web Application Developers
  • Author(s): Kris Hadlock
  • Release date: October 2006
  • Publisher(s): Sams
  • ISBN: 0768667143