Prev | Current Page 98 | Next

Larry Ullman

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


4 Enter invalid letters and
click GO to see the result if no
employees in the database
matched the search term.
enabling an Ajax search 123
extra bits
what we??™ll do p. 100
??? In this example, I suggest
that users enter only a couple
of letters because the database
has only 20 records in it.
With the employees entered
in chapter 1, ???creating the
database,??? Gr will return two
records but Gre only one.
If your database had more
names in it, entering longer
values would be appropriate.
add the Ajax
elements p. 102
??? The ajax.js fi le, written in
chapter 3, ???browsing using
Ajax,??? defi nes a function that
returns a browser-specifi c
XMLHttpRequest object. This
fi le is needed by any page that
performs any Ajax operations.
??? Because the DIV, where the
results will be reported, has
an id value of results, it??™ll
be formatted according to
the rules dictated in style.
css. This is the same as the
results DIV in dept_form.
html and in add_employee.
html. For starters, the DIV will
be invisible when the page is
fi rst viewed.
set up the Ajax p. 105
??? The encodeURIComponent()
function makes it safe to pass
in the URL whatever value the
user entered in the form.


Pages:
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110