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
8
Chapter 1
Ajax to the rescue
Do you see what the problem is? Every time Katie wants to nd out the
latest number of boards sold, the entire screen is redrawn, and she’s left
with the Internet version of snow blindness.
Didn’t you say that Ajax will let
me update the screen without all
that reloading? Something about
updating just part of the page?
Use Ajax to fix the web report...
Let’s change Katie’s report to use Ajax to send the request
for updated board sales. Then we can get the response from
the server, and update the web page using JavaScript and
dynamic HTML. No more page reloading, and Katie will be
a happy snowboarder again.
Maybe you’ll even score a
free board...
ditching page reloads
you’re on your way 4
9
next generation applications
You’re going to need a couple of JavaScript functions to turn Katie’s report
into an Ajax-powered app. Below are the names of three JavaScript
functions. Draw a line connecting each function name to what you think
it will do in the final version of the Boards app.
getBoardsSold()
updatePage()
createRequest()
Create a new object for
talking to the web server.
Ask the server for the latest
snowboard sales gures.
Set the number of boards sold
and the cash that Katie’s made
to the most current values.
Answers on page 63.
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