<html> <head> <script type="text/javascript" src="/upload/file/xml/loadxmldoc.js"> </script> </head> <body> <script type="text/javascript"> xmlDoc=loadXMLDoc("/upload/file/xml/books.xml"); var x=xmlDoc.getElementsByTagName('title'); for (i=0;i<x.length;i++) { document.write(x[i].childNodes[0].nodeValue); document.write("<br />"); } </script> </body> </html>
编辑上面的文字,按下“查看结果”,效果会显示在右边 Create by 软晨网(RuanChen.com)