Table of Contents
Preface
Chapter 1: The World of AJAX and PHP
Chapter 2: JavaScript and the AJAX Client
Chapter 3: Object Oriented JavaScript
Chapter 4: Using PHP and MySQL on the Server
Chapter 5: AJAX Form Validation
Chapter 6: Debugging and Profiling AJAX Applications
Chapter 7: Advanced Patterns and Techniques
Chapter 8: AJAX Chat with jQuery
Chapter 9: AJAX Grid
Appendix: Preparing Your Working Environment
Index
- Chapter 1: The World of AJAX and PHP
- The big picture
- AJAX and Web 2.0
- Building websites since 1990
- HTTP and HTML
- PHP and other server-side technologies
- JavaScript and other client-side technologies
- What's missing?
- The world of AJAX
- What is AJAX made of?
- Uses and misuses of AJAX
- Resources and tools
- Setting up your environment
- Building a simple application with AJAX and PHP
- Summary
- The big picture
- Chapter 2: JavaScript and the AJAX Client
- JavaScript and the Document Object Model
- JavaScript events and the DOM
- Even more DOM
- JavaScript, DOM, and CSS
- Using the XMLHttpRequest object
- Creating the XMLHttpRequest object
- JavaScript exception handling
- Creating better objects for Internet Explorer 6
- Initiating server requests using XMLHttpRequest
- Handling server response
- Creating the XMLHttpRequest object
- Working with XML structures
- Handling more errors and throwing exceptions
- Creating XML structures
- Summary
- Chapter 3: Object Oriented JavaScript
- Why is OOP in JavaScript important?
- Object-oriented programming concepts
- Encapsulation
- Inheritance
- Polymorphism
- Object-oriented programming with JavaScript
- JavaScript objects are dictionaries
- JavaScript functions
- JavaScript functions are first-class objects
- Inner functions
- Closures
- JavaScript classes
- Constructors
- Class diagrams
- Referencing external functions
- Prototype objects
- Instance methods and properties
- Static methods and properties
- Private members
- The JavaScript execution context
- var x, this.x, and x
- Using the right context
- JavaScript OOP in practice: Introducing JSON
- JSON concepts
- A simple JSON example
- Summary
- Chapter 4: Using PHP and MySQL on the Server
- PHP, DOM, and XML
- PHP and JSON
- Passing parameters and handling PHP errors
- Working with MySQL
- Creating database tables
- Manipulating data
- Connecting to your database and executing queries
- Summary
- Chapter 5: AJAX Form Validation
- Implementing AJAX form validation
- XMLHttpRequest, version 2
- AJAX form validation
- Summary
- Chapter 6: Debugging and Profiling AJAX Applications
- Debugging and profiling with Internet Explorer
- Enabling debugging in Internet Explorer 6 and 7
- Debugging in Internet Explorer 8
- Other Internet Explorer debugging tools
- Debugging and profiling with Firefox
- Firebug
- Venkman JavaScript debugger
- Web Developer
- Summary
- Debugging and profiling with Internet Explorer
- Chapter 7: Advanced Patterns and Techniques
- Predictive fetching pattern
- Progress indicator pattern
- Unobtrusive JavaScript
- Progressive enhancement and graceful degradation
- Asynchronous file upload with AJAX
- HTTP and how file upload works
- Iframe for asynchronous file upload with AJAX
- Cross-domain calls
- Cross-domain calls using a server proxy
- Cross-domain calls using Flash
- Cross-domain calls using iframes
- Cross-domain calls using JSONP
- Cross-site request forgery
- JSON hijacking
- Mitigations of CSRF
- Cross-site scripting
- Exploits
- Non-persistent XSS
- Persistent XSS
- Mitigations of XSS
- Input validation
- Escaping
- Cookies security
- Exploits
- Summary
- Chapter 8: AJAX Chat with jQuery
- Chatting using AJAX
- jQuery
- Before we get started
- The first steps
- jQuery DOM Selectors
- jQuery wrapper object
- Method chaining
- Event handling
- A simple example
- Basic concepts
- AJAX chat
- The chat application
- Summary
- Chapter 9: AJAX Grid
- Implementing the AJAX data grid
- Code overview
- The database
- Styles and colors
- The server side
- Creating the grid, step by step
- Code overview
- Summary
- Implementing the AJAX data grid
- Appendix: Preparing Your Working Environment
- Installing XAMPP
- Installing XAMPP on Windows
- Installing XAMPP on Linux
- Preparing the AJAX database
- Installing XAMPP