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
70
Chapter 2
Break Neck Pizza, Ajax-style
Instead of starting with old 1990s development ideas, let’s look at what the Break
Neck app should do. Then you can use your new asynchronous programming skills
to make sure Break Neck’s order form is a responsive, customer-friendly means of
getting great pizza, fast. Here’s how things should work:
Yeah, come on over, the pizza’s
already here. Unbelievable... it can’t
have been ten minutes, and I didn’t
even have to enter my address.
The customer starts
out by entering his
phone number.
The order form then lls in the
customer’s address automatically.
Once the customer has
entered in his order, he
clicks “Order Pizza”...
...and Alex, the delivery
boy, can get the hot
pizza right to the
customer’s front door.
The customer enters their
pizza order into the form,
without waiting on their
address to get lled in.
an asynchronous approach
you’re on your way 4
71
ajax requests
Just like the Boards ‘R’ Us application in Chapter 1, you’re going to
need several JavaScript functions to make the Break Neck app work.
Below on the left are the names of two JavaScript functions, and on
the right are several lines of JavaScript. Draw arrows from the lines
of code to the function each line of code should go into.
getCustomerInfo()
updatePage()
if (request.readyState == ...
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