74
Chapter 2
Step 1: Get the customer’s phone number
It looks like the rst thing we need to do with the Break Neck app is make
sure we can get the customer’s phone number. That’s going to take some
HTML, a bit of JavaScript, and a lot of help from the web browser.
<script>
var request...
function foo()
{
...
}
</script>
JavaScript
Customer’s Phone Number
First, we need to make sure the Break
Neck HTML form lets the customer
enter in their phone number.
Next, we need to setup the phone
number eld so that when it’s changed,
a new JavaScript function gets called.
The JavaScript function
we’ll write needs to get the
phone number out of the
Break Neck order form.
In Step 2, we’ll send the
phone number on to the
Break Neck web server.
The browser
can run a
function when
events occur in
a web page, and
give your JavaScript
access to user-entered
information in the page.
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
Here’s the part of the Break
Neck app we’re focusing on in
the next few pages.
Web Server
getting the user’s information