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
161
asynchronous applications
Now wait just a second. That’s it? You
completely forgot something—what if
the rst coffee maker is already brewing
coffee? And what about the second coffee
maker? When should we use it?
Each coffee maker can only brew one cup at a time, so what if
the rst coffee maker is already brewing coffee? Somehow we
need to nd out if the rst coffee maker status is “Idle” before
we send a new request. If it’s busy, we can try the second
coffee maker. And if that one’s busy... well, then Jim’s gonna
have to wait a bit for his coffee.
How do you think we can get the status of each coffee maker?
Here’s the HTML for the rst coffee maker... what do you
think we should do?
<div id=”coffeemaker1”>
<h2>Coffee Maker #1</h2>
<p><img src=”images/CoffeeMaker1.gif”
alt=”Coffee Maker #1” /></p>
<div id=”coffeemaker1-status”>Idle</div>
</div>
Which coffee maker should we use?
Remember, the second
coffee maker HTML is
very similar to this.
How do you think we can nd out the status of the coffee
makers? And how can we update the status when one is
brewing coffee, and when the coffee maker nishes brewing?
brain
power
Keep thinking about
this, and we’ll come
back to it a little
later in the chapter.
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