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
279
post requests
Break Neck doesn’t seem to be asking for anything that complicated. Let’s see if we
can convert the Break Neck pizza form submission into an asynchronous request.
Here’s what you’ll need to do:
Submitting a form with Ajax
submitOrder()
showConrmation()
2
4
1
Your new JavaScript function, submitOrder(),
will submit the customer’s order to the
Break Neck server asynchronously, using the
information in the pizza order form.
In this step, you’ll have to write
a new callback function. This
will need to take the delivery
time that you get from the
Break Neck server, and give the
customer a conrmation that her
order is on its way.
First, you’ll need to change the Break Neck
HTML: instead of letting a customer place
her order with a submit button, the “Order
Pizza” button should call a new JavaScript
function. You’ll write this function in the
next step, and call it submitOrder().
Break Neck server
3
You’ll have to make sure the
PHP script on Break Neck’s
server doesn’t send back
HTML anymore... instead, it
should return how much time
it will take for the pizza to
arrive at the customer’s door.
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