Table of Contents (summary)
Intro
1 Using Ajax: web applications for a new generation
2 Speaking the Language: making ajax requests
Interlude
3 She Blinded Me with Asynchrony: asynchronous apps
4 Web Page Forestry: the document object model
4.5 A Second Helping: devloping dora applications
5 Saying More with POST: post requests
Interlude
6 More Than Words Can Say: .vml requests and responses
7 A Fight to the Finish:json versus xml
Appendix 1 : A Few Special Bonus Gifts: extras
Appendix 2: 'All I Want Is the Code": ajax and dora utilities
Index
Table of contents (the real thing)
Intro
Your brain on Ajax. Here you are trying to learn something, and your brain is
doing you a favor by making sure the learning doesn't srick. Your brain's thinking,"Better
leave room for more important things, like which wild animals to avoid and whether naked
snowboarding is a bad idea." So how do you trick your brain into thinking that your life
depends on knowing how to program asynchronously?
Who is this book for?
we know what your brain is thinking
Metacognition
Bend your brain into submission
Read Me
Technical reviewer
Acknowledgments
1 Using Ajax
The Web, Reloaded
Welcome to the new millenium
"Reload? We don't need no stinking reloads."
The highlight reel: Chapter 1
Creating a request object
PHR.. at a glance
What the server used to do...
What the server should do now
Initialing a connection
Connecting to the web server
Adding an event handler
Coding the callback function
How we see web apps...
Introducing the web browser
What should the browser do with the server's response?
Sending instructions to the browser
Getting the server's response
Checking for the right ready state
60 second review
2 Speaking the Language
Break Neck Pizza Delivery
Break Neck Pizza, Ajax-style
HTMI, 101 : accepting user input
Event handlers connect HTML to JavaScript
Using the DOM to get user input
Where's the web browser?
Creating a request objcct (revisited)
Supporting multiple browsers
JavaScript doesn't have to be in a function
PHR.. at a glance
Request URLs deliver data to the server
Seud the request to the server
Retrieving data from the server
HTTP ready states
Checking the ready state
What is the browser doing?
Get the server's response from the request object
Test driving the Brcak Neck app
when browsers cache request URLs...
60 second review
3 She Blinded Me with Asynchrony
What does asynchronous really mean?
Building an Ajax-powered coffee maker
Iterative developn~ent and Ajax apps
Moving JavaScript to external files
Breaking up theJavaScript
Sending an asynchronous request
Getting the value of a radio group
Espresso Talk: Asynchronous and Synchronous Application
Getting the text content of a <div>
Setting the text content of a <div>
Clearing the order form
PHP... at a glance
Writing the callback function
IntroducingJavaScript's substring() function
The final test drive (right?)
We need two request objects!
Creating two request objects
welcome to the world of asynchrony!
4 Web Page Forestry
Need a dynamic application?
Meet the DOM
Using the DOM without Ajax
How the browser sees your HTML
Write your own... Web Dictionary
Order matters to the web browser
Browsers see the world upside down
The DOM tree
Moving around in a DOM tree
The node knows.., pretty much everything
Some browsers don't recognize Node
The Great Chapter 4 Coding Challenge
4.5 A Second Helping
Evervone's a critic
What's the game plan?
The big picture
Setting up CD covers
Programmatically adding event handlers
Adding a CD to the top 5
Pay attention to "this"
Adding children to an element
An element can have only one parent
More additions to our DOM tree
A final test drive
5 Saying More with POST
Repeat business rocks
Submitting a form with Ajax
Send the order to the server
PHR.. at a glance
When things go wrong...
The DOM is connected to what a customer sees
Test driving Break Neck
Error messages and response headers
The server talks back
Break Neck error handling
GET requests versus POST requests
Web servers unencode POST data
Send more data with a POST request
Trying out POST requests
The mysterious POST data
Request headers
Response headers
Setting the content type
6 More Than Words Can Say
Servers don't get to say much
Speak Up!
The limited vocabulary, of a server
XML: just what the doctor ordered
Revisiting Boards 'R' Us
The problem with Boards 'R' Us
The problem with proprietaW data formats
Filling that XML prescription
PHP... at a glance
Using responseText to get raw XML
Remember DOM trees?
Using responseXML in your code
Finding elements by their tag name
Testing out XML in Boards 'R' Us
XML is a language to define other languages
Don't try and use XMI, for everything
XML for requests?
Which data format?
7 A Fight to the Finish
A new data format
A review of request and response formats
Fighting words: XML and JSON
You use the DOM to work with XML
You work withJSON using "normal" JavaScript
JSON is JavaScript
TheJSON data format
JSON on the server
JSON comes across as text
What data format should you send your requests in?
Which is the better data format?
a.1 A Few Special Bonus Gifts
Ajax toolkits
script.aculo.us and UI toolkits
Inspecting the DOM
Using JSON libraries in your PHP scripts
Using eval0 withJSON
a.2 It's time for a little bonus credit.
ajax.is
Using ajax.js
text-utils.js
Using text-utils.js