Skip to Main Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate content levelBeginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
you’re on your way 4
145
asynchronous applications
Building an Ajax-powered coffee maker
Two coffee makers...
...and a whole ofce of caffeine addicts.
As the ofcial “coffee pot manager,” it’s your job to make sure that the caffeine
needs of your ofcemates are met... and quickly, at that. All your mates are
caffeine addicts, and they get a bit testy if there’s no fresh coffee on hand. Good
thing that there are two coffee makers; even if one order is being brewed, your
co-workers can place another order, and have it lled by the second coffee maker.
You’re going to build an Ajax application to allow
your co-workers to order their coffee online.
You don’t want anyone coming after you with empty coffee cups, so let’s write an
Ajax application for ordering coffee and keeping track of the status of both coffee
makers. Here’s what it will look like:
Here’s the second coffee
maker. If an order is brewing
in coffee maker #1, this
coffee maker will handle any
additional orders. Just like
coffee maker #1, it takes a
little time to brew a cup.
This is the main
coffee maker. Anytime
an order is placed, and
no coffee is brewing,
this coffee maker
handles the order. It
takes a little time to
brew a cup, though,
and the coffee maker
can only brew one cup
at a time.
Here’s where you place
your order. You enter
your name, the size of
the cup you want, and
what type of beverage
you’re interested in. ...
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

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Head First Ajax

Head First Ajax

Rebecca M. Riordan

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content