10.02.2014 Views

Beginning Ajax With ASP.NET (2006).pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3<br />

Node Type Type Description Comments<br />

Number<br />

9 Document Represents a reference to the See previous detailed<br />

root object in the document tree, discussion in this chapter<br />

that is, a reference to the entire<br />

document<br />

10 Document Type A Document Type Definition For example, the DOCTYPE element<br />

in an HTML document:<br />

<br />

11 Document Represents a lightweight<br />

Fragment Document object, or a portion of<br />

a document<br />

12 Notation Represents a notation declared DTD = Document Type<br />

in the DTD<br />

Definition. An older form of<br />

defining an XML document<br />

structure<br />

Try It Out<br />

Using Node Properties<br />

As an example of utilizing these properties, you can examine one of the paragraph () nodes from<br />

your previous example. You will add some further script code to the previous example, as shown in the<br />

following code block:<br />

var node = paragraph;<br />

var msg = “Node Name: “ + node.nodeName;<br />

msg += “\nNode Type: “ + node.nodeType;<br />

msg += “\nNode Value: “ + node.nodeValue;<br />

msg += “\nNode Child Name: “ + node.firstChild.nodeName;<br />

msg += “\nNode Child Type: “ + node.firstChild.nodeType;<br />

msg += “\nNode Child Value: “ + node.firstChild.nodeValue;<br />

alert(msg);<br />

This will produce the dialog box shown in Figure 3-6.<br />

66<br />

Figure 3-6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!