You can access that value
using the DOM.
??? The encodeURIComponent()
function ensures that the selected
form value is safe to send in a URL.
??? In this JavaScript code there are
two anonymous functions.
These are functions not given a
name when defi ned. Anonymous
functions are used when it??™s necessary
to encapsulate a chunk of
code but it??™s not necessary to call
that code like a standard function.
??? The XMLHttpRequest readyState
value stores the current Ajax
transaction state, on a scale from
0 to 4. The most important of
these is 4, which means that the
transaction is complete.
(cont.)
call the function p. 29
??? The window.onload property
tells the JavaScript the name of
the function to call once the page
has completely loaded. In this
case that??™s init, short for
initialize (i.e., set things up).
??? The benefi t of calling the initialization
function in this way (rather
than just calling it directly) is that
the downloading and drawing of
the page in the Web browser won??™t
have to wait for the JavaScript to
do its thing. In a slight way, this
makes for a better user experience.
Pages:
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56