To
place content on the page,
we??™ll add branches to the
results section. So to prepare
the page for the XML
data, we need to clear out any
existing nodes in results.
We do so by applying the
removeChild() function to
results, removing the last
node, until there are no more
nodes left.
handle the XML p. 113
??? The server??™s response is availabe
in two attributes of the
XMLHttpRequest object. It
can be found as plain text in
responseText or as XML data
in responseXML.
??? The XML data can be accessed
just like elements on
an HTML page, using the
Document Object Model. So
data.getElementsByTagName
(???name??™) refers to every item
in the XML data with a name
of name.
handle the
response p. 111
??? In the init() function, we tell
the JavaScript to call a function
called handleResponse()
whenever the readyState
value changes. This value will
change multiple times during
an Ajax request, so this function
will be called multiple
times.
??? The XMLHttpRequest status
attribute stores the HTTP
status code returned by the
server-side page. There are
dozens of status codes from
200, meaning that everything
was OK, to values over 500,
which are normally server
errors.
Pages:
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113