Skip to Main Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate content levelBeginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
342
Chapter 6
The problem with Boards ‘R’ Us
The Boards ‘R’ Us report still uses an asynchronous request to talk to the
server, and since you solved their caching problems, the report works for
everyone in the company (including Katie’s man running Windows).
But the server needs to send back three sales numbers now: the total
number of boards sold, as well as the number of boots and bindings sold.
<script>
var request...
function foo()
{
...
}
</script>
Request
Updated Sales
Totals
PHP script
<?php
require(‘lib.php’);
function go() {
$myVar = ...
return ...
}
?>
This is the same request
as in the version of the
report that only dealt
with snowboards.
In this new version, the server has to
send back three numbers: the sales
totals for boards, boots, and bindings.
PHP script
<?php
require(‘lib.php’);
function go() {
$myVar = ...
return ...
}
?>
?
?
?
How can Katie’s PHP script
send back three different
numbers at the same time?
problems at boards ‘r’ us
you’re on your way 4
343
xml requests and responses
Great! Someone nally
wants
me to
say more, and I don’t know how. I
HATE being a server!
Dr. Zigmund: Progress, my dear friend! Now people vant to hear you.
Server: But how can I say three things at one time? This is my only chance... and
I’m going to blow it.
Dr. Zigmund: I don’t zink you have been using my pre-zcription, ...
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

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Head First Ajax

Head First Ajax

Rebecca M. Riordan

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content