显示节点列表的长度
- <html>
- <head>
- <script type="text/javascript" src="/example/xdom/loadxmldoc.js"></script>
- </head>
- <body>
- <script type="text/javascript">
- xmlDoc=loadXMLDoc("/example/xdom/books.xml");
- x=xmlDoc.documentElement.childNodes;
- document.write("子节点的数目:" + x.length);
- </script>
- </body>
- </html>