读书人

没有分了,但是还是要问个javascript解

发布时间: 2012-03-30 17:32:09 作者: rapoo

没有分了,但是还是要问个javascript解析xml的问题
xml数据就存放在 test.html内
如何把itmes的数据逐条读出来

数据:
<html>
<head>
<title> test.html </title>
</head>
<body>
<!---
xml 数据 开始
-->
<items>

<item>
<title> title1 </title
<body> body1 </body>
</item>

<item>
<title> title2 </title
<body> body2 </body>
</item>

<item>
<title> title3 </title
<body> body3 </body>
</item>


</items>

<!---
xml 数据 结束
-->
</body>
</html>



[解决办法]
方法参考
http://msdn2.microsoft.com/en-us/library/ms535918.aspx
[解决办法]
getElementsByTagName( "items ")[0].getElementsByTagName( "item ");

读书人网 >JavaScript

热点推荐