Prev | Current Page 45 | Next

Larry Ullman

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


40 browsing using Ajax
extra bits
display the results p. 36
??? Once again, the Document
Object Model allows you to easily
access individual elements in
a page. The code document.
getElementById(???results??™)
refers to a div in the HTML page
that has an id of results.
??? The Cascading Style Sheet
style.css sets the display
attrbute of items with an id of
results to none. The net e?¬? ect
will be that such elements are
not visible when a page is fi rst
loaded. This is desired because
such items have a solid green
border around them and it??™d be
distracting to see that prior to
actually retrieving the results.
For the purposes of these examples,
we??™ll assume it means the
response was fi ne.
??? By referring to the Document
Object Model, we can forcibly
submit the form. The document.
getElementById(???dept_
form??™) code refers to the form
(which has an id value of dept_
form). The .submit() part of
the code submits it.
print the employees p. 33
??? This PHP script is almost exactly
like dept_results.php from
Chapter 2. The main di?¬? erence
is that it does not include the
opening and closing ,
, and tags, nor
does it include most of the stu?¬?
that goes within those tags.


Pages:
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57