186
Chapter 3
A closer look at the request object
To gure out what’s going on with Jim’s order, let’s take a closer look at each
step of the test drive on the last two pages, and what our request object is
actually doing.
troubleshooting the coffee maker app
1
Enter an order for Jim: he
wants a large mocha. Then
click “Order Coffee”.
s
e
n
d
(
)
o
p
e
n
(
)
s
e
t
R
e
q
u
e
s
t
H
e
a
d
e
r
s
(
)
Request Object
Remember, the request
object is created by the
static JavaScript in ajax.js.
At this point, the request
object is used to send a request
to the server-side coffee maker.
Make Jim a large mocha
using the rst coffee maker
coffeemaker.php
s
e
n
d
(
)
o
p
e
n
(
)
s
e
t
R
e
q
u
e
s
t
H
e
a
d
e
r
s
(
)
Request Object
Nothing changes for the
request object during this
step. The server is still
brewing Jim’s coffee.
2
Jim’s order starts brewing,
using the rst coffee maker.
coffeemaker.php
The coffee maker is
brewing Jim’s large mocha.