Prev | Current Page 103 | Next

Larry Ullman

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

It makes the
element, but you then have to
add it to the page using append-
Child().
handle the name p. 116
??? The setAttribute() function
takes two arguments:
the name of the attribute to
set and the value it should be
given.
??? To get the values from
the XML data, refer to
arrayname[i].first-
Child.nodeValue. The
arrayname[i] refers to a
specifi c element in the array;
firstChild refers to the fi rst
branch of that element (which
we know is the only node each
element has); and nodeValue
refers to the actual content
found there (which is the
text).
??? The appendChild() function
adds the element in parentheses
to the element named
before the period.
enabling an Ajax search 127
handle the email p. 120
??? It isn??™t until the employee
element, with all its subelements
(or nodes), is appended
to the results DIV that the
employee data will appear on
the HTML page.
??? If the PHP script returns fi ve
employee records, then the
results DIV will end up
having fi ve child nodes. Each
of these nodes will be a paragraph
element, within which
are the span for the name,
the strong element and other
department text, the a element
for the email address,
and the two breaks.


Pages:
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115