Prev | Current Page 95 | Next

Larry Ullman

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

createElement(???strong??™);
dept_label = document.createTextNode(???Department??™);
strong.appendChild(dept_label);
employee.appendChild(strong);
enabling an Ajax search 117
dept_node = document.createTextNode(???: ??? +
departments[i].firstChild.nodeValue);
employee.appendChild(dept_node);
br = document.createElement(???br??™);
employee.appendChild(br);
4 Another text node is generated, with a value of the
colon, followed by a space, followed by the name of
the department from the XML data.
5 This latest text node is attached to the paragraph,
which is employee.
6 A break element is added to the paragraph so
that the pieces to follow will begin on the next line.
handle the department (cont)
118 enabling an Ajax search
handle the email
The email address is tricky because it should be linked so that clicking on the
email address creates an email to that person.
1 Another element, of type a, is created. This type
of element is for any link.
2 The href attribute of the a element is given a
value of mailto: plus the person??™s email address
from the XML data.


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