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
you’re on your way 4
351
xml requests and responses
Using responseXML in your code
You’ve already seen that the responseText property of your request
object lets you read the XML that the server responds with. But we don’t
want a bunch of text that looks like XML; we’re DOM experts now, right?
Using the responseXML property, you can get the DOM tree for the
server’s response, and then work with that XML using the DOM.
And since the HTML for Katie’s Boards report is another DOM tree, we
just want to grab values from the XML DOM and stick them in the HTML
DOM. Let’s see exactly what we need to do:
Even if you don’t feel like an
expert, you’re kicking butt!
And by the time you nish this
chapter, you’ll be even better at
the DOM than you are now.
totals
boards-sold
boots-sold
bindings-sold
“1710“
“315“
“85“
Here’s the XML DOM from
the Boards server.
span id=”boards-sold”
span id=”bindings-sold”
span id=”boots-sold”
“1710“
“315“
“85“
Here’s Katie’s web report,
with a few of the <span>
elements in the DOM
tree called out.
We need to take the values from the XML
DOM tree and use them to update the
values in the HTML DOM tree.
The browser puts this DOM tree
in the responseXML property of
the request object.
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