CITATION

Holzner, Steven. Ajax : A Beginner's Guide. US: McGraw-Hill Osborne Media, 2008.

Ajax : A Beginner's Guide

Published:  September 2008

eISBN: 9780071595315 0071595317 | ISBN: 9780071494298
  • Contents
  • Introduction
  • 1 Essential Ajax
  • What Is Ajax?
  • An Example: Ajax-driven Tom Riddle’s Diary
  • Try This: Tom Riddle’s Diary
  • Updating Web Page Text with Ajax
  • Chatting in Real Time with Ajax
  • Dragging and Dropping with Ajax
  • Downloading Images with Ajax (and Dynamic HTML)
  • 2 Getting to Know JavaScript
  • Try This: Test ajax.html
  • Introducing JavaScript
  • Getting Started with JavaScript
  • Try This: Get javascript.html to Work
  • Adding Comments to Your Code
  • Using External JavaScript Files
  • Handling Events in the Browser
  • Try This: Get click.html to Work
  • Working with JavaScript Functions
  • Passing Data to Functions
  • Try This: Pass Data to Functions
  • Returning Data from Functions
  • Try This: Return Data from Functions
  • Working with Variables
  • Putting It All Together with Operators
  • Grooving with the if Statement
  • Try This: Test the if Statement
  • Using the else Statement
  • Try This: Test the else Statement
  • Working with the Logical Operators
  • Try This: Test the Or Operator
  • Over and Over with the for Loop
  • Try This: Test the for Loop
  • Keep on Looping with the while Loop
  • Which Browser Does the User Have?
  • Try This: Use browser.html
  • 3 Creating Ajax Applications
  • Try This: Get ajax.html to Work
  • Taking ajax.html Apart
  • Creating the JavaScript
  • Creating the XMLHttpRequest Object
  • Opening the XMLHttpRequest Object
  • Getting Ready for the Data Download
  • Using the readyState Property
  • Using the status Property
  • Displaying the Fetched Data
  • Connecting to the Server
  • Adding Some Server-Side Programming
  • Try This: Get ajax2.html to Work
  • Sending Data to the Server Using GET
  • Sending Data with URL Encoding
  • Writing the PHP
  • Interacting with dataresponder.php
  • Sending Data to the Server Using POST
  • Writing the PHP
  • Interacting with dataresponderpost.php
  • Using Ajax Together with XML
  • 4 Full Throttle Ajax
  • Handling Multiple XMLHttpRequest Objects in the Same Page
  • Using Two XMLHttpRequest Objects
  • Try This: Get double.html to Work
  • Using an Array of XMLHttpRequest Objects
  • Try This: Get array.html to Work
  • Using Inner Functions
  • Try This: Get Inner Functions to Work
  • Downloading JavaScript
  • Try This: Download JavaScript
  • Connecting to Google Suggest
  • Creating the Search Term Field
  • Writing the JavaScript
  • Displaying the Matches
  • Creating google.php
  • Downloading from Other Domains with Ajax
  • Try This: Contact Another Server Using Ajax
  • Getting More Info: HTML Header Requests and Ajax
  • Try This: Get a Specific HTML Header
  • Defeating Caching
  • 5 Using Ajax Frameworks
  • Creating ajaxframework.js
  • Downloading Text with the downloadText Function
  • Try This: Get downloadText.html to Work
  • Downloading XML with the downloadXml Function
  • Try This: Get downloadXml.html to Work
  • Posting Data and Downloading Text with the postDataDownloadText Function
  • Posting Data and Downloading XML with the postDataDownloadXml Function
  • Using the libXmlRequest JavaScript Ajax Framework
  • Using the AJAXLib JavaScript Ajax Framework
  • 6 Handling XML in Ajax
  • Building Some XML
  • Working with XML in JavaScript
  • Getting the Document Element
  • Try This: Get the Number of Children of the Document Element
  • Accessing Any XML Element
  • Try This: Find the Second Guest
  • Handling Whitespace in Firefox
  • Handling Cross-Browser Whitespace
  • Accessing XML Data Directly
  • Validating Your XML
  • 7 Working with Cascading Style Sheets with Ajax
  • Drawing the User’s Attention to Downloaded Text
  • Styling Text Using CSS
  • Try This: Change the Size of Text
  • Styling Colors and Backgrounds Using CSS
  • Try This: Use Preassigned Colors
  • Setting Element Location in Web Pages
  • Try This: Adding an Additional Button
  • Setting the Stacking Order of Web Page Elements
  • A Complete Ajax CSS Example: menus.html
  • 8 Handling Dynamic HTML with Ajax
  • Updating Pages with Dynamic HTML Methods
  • Updating Pages with Dynamic HTML Properties
  • Using Text Ranges in Internet Explorer
  • Creating New HTML Elements with createElement
  • Editing Tables On-the-Fly
  • Try This: Remove Table Rows On-the-Fly
  • Using document.write to Write Documents to the Browser
  • 9 Introducing PHP with Ajax
  • Getting Started with PHP
  • Returning Text to the Browser
  • Try This: Send HTML to the Browser
  • Returning XML to the Browser
  • Adding Comments to Your PHP Code
  • Storing Data in Variables
  • Storing Numbers in Variables
  • Storing Text Strings in Variables
  • Interpolating Variables into Text Strings
  • Handling Data in PHP Arrays
  • Handling Data with Operators
  • Branching with the if Statement
  • Using for Loops in PHP
  • Looping with the while Loop
  • Try This: Display a Message Multiple Times
  • Looping with the do...while Loop
  • Looping with the foreach Loop
  • 10 PHP in Depth
  • Introducing PHP Functions
  • Passing Data to Functions in PHP
  • Try This: Pass Multiple Items to a Function
  • Creating Default Arguments in Functions
  • Returning Data from Functions
  • Working with HTML Controls in PHP
  • Using Text Fields
  • Using Checkboxes
  • Using Radio Buttons
  • Using List Boxes
  • Using Image Maps
  • 11 Validating User Input with Ajax and PHP
  • Displaying All the Data in an HTML Form
  • Creating the HTML
  • Creating the PHP
  • Working with PHP Server Variables
  • Creating the HTML
  • Creating the PHP
  • Getting Your Data in Array Format
  • Creating the HTML
  • Creating the PHP
  • Wrapping Applications into a Single PHP Page
  • Validating Input from the User
  • Validating Integers
  • Validating Text
  • 12 Using the HTML DOM and Ajax
  • Getting to Know the DOM
  • Appending New Elements to a Web Page Using the DOM and Ajax
  • Replacing Elements Using the DOM
  • Handling Timeouts in Ajax
  • Downloading Images with Ajax
  • Index