Skip to Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
you’re on your way 4
177
asynchronous applications
1Jim
coffeemaker.php
What do we do with the server’s response?
You’ve completed orderCoffee(), and now coffeemaker.php is
done. When you send a request to brew coffee to one of the coffee makers,
coffeemaker.php runs and then returns the coffee maker that completed the
order, as well as the name of the person who placed the order.
The server returns the coffee maker that
nished brewing, and then the name of the
person who placed the order.
When the browser gets a response
from the server, it will run the
callback you indicated: serveDrink().
serveDrink() needs to let the person
who placed the order know their
coffee is ready, and set the status of
the right coffee maker back to “Idle”.
coffee.js
serveDrink()
Make Jim a large mocha
using the rst coffee maker
Jim enters his coffee order, and
clicks “Order Coffee”.
coffee.js
orderCoffee()
orderCoffee()
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content