The
reason why is that all of this
page??™s results will be inserted into
the HTML page via JavaScript.
That page already has the proper
HTML tags.
handle the response p. 35
??? 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. A status code of
304 indicates that the page was
found but had not been modi-
fi ed since a certain date and time.
browsing using Ajax 41
??? The process of hiding, then showing
the results area using CSS and
JavaScript is intended to make it
more obvious when the HTML
page is updated.
??? Referring to an element??™s
innerHTML value is a quick way
to place next text on a page. An
alternative is to add nodes to the
DOM. You??™ll see this in Chapter 7,
???enabling an Ajax search.
Pages:
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58