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
36
Chapter 1
So now you’ve taken care of talking to the server, and you’re
ready to get the server’s response, and update the Boards
report with new numbers. It’s time to write updatePage().
Remember what this function is supposed to do?
Step 3: Coding updatePage()
updatePage() gets the server’s
response...
...and then updates the
numbers in the web report.
Now the server’s response only has
the number of boards sold in it.
How can your updatePage() function get the response from Katie’s PHP script?
Remember, the request to the script was made in getBoardsSold()... and this is
supposed to be an asynchronous application. That means Katie shouldn’t have to
wait around while the server is getting new sales totals.
So how does updatePage() get the response from the server? Think about this for
a minute or two, and then turn the page.
brain
power
<script>
var request...
function
updatePage() {
...
}
</script>
Updated Number
of Boards Sold
Boards
Sold
Cash for
Slopes
updatePage()createRequest() getBoardsSold()
updating the web report
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