you’re on your way 4
91
ajax requests
brain
power
Look back at Step 1 on page 88, and think about how we handled
creating the request variable. Does this give you any ideas about how
you could let customers know about any problems before they start
using the Break Neck order form?
I just tried this, and it really sucks that I had
to enter my phone number in to nd out that
things weren’t working. Couldn’t you have told me
that before I bothered typing my number in?
In the Break Neck app, customers only have to
ll out one eld before getCustomerInfo()
gets called, and your code tries to create a new
request object. Then, if something’s wrong, the
customer gets an error message.
But imagine how annoying it would be to ll out
an entire form, and then nd out that something’s
wrong... what a waste of time!
It looks like we need to nd a way to let users
know about any problems much earlier... like
before they start typing into the Break Neck form.
Don’t annoy the customer!
Man, Break Neck pizza rocks. There’s
nothing like a breakfast of cold pizza, a
whipped latte from Starbuzz, and the
Webville Times to read.
<script>
var request...
function foo()
{
...
}
</script>
JavaScript
<script>
var request...
function foo()
{
...
}
</script>
Customer’s Phone Number
Customer’s Address
Customer’s Order