Prev | Current Page 76 | Next

Larry Ullman

"Building a Web Site with Ajax: Visual QuickProject Guide"

It
can be found as plain text in
responseText or as XML data
in responseXML.
??? The XML data can be accessed
just like an HTML page, using
the Document Object Model. So
data.getElementsByTagName
(???error??™) refers to every item
in the XML data with a name of
error.
??? The syntax of the for loop is a
common way to access every
item found in an array. Within
the loop, the specifi c array item
is accessed via arrayname[i].
??? The error elements in the XML
data have the names of the
problematic form elements as
their values. To access these values,
refer to the error element,
which is errors[i] within the
loop, followed by .firstChild.
nodeValue. It??™s a rather complex
syntax but it works. More
information on a child and a
node can be found in Chapter 7,
???enabling an Ajax search.???
86 adding records via Ajax
Thus far in the book we??™ve made two aspects of an employee-directory site.
First, we created a way to browse employees by department. Then we made it
possible to add employees to the database. Let??™s put in one last logical feature:
the ablity to search for employees by last name.


Pages:
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88