本文实例讲述了JS实现读取xml内容并输出到div中的方法。分享给大家供大家参考,具体如下:
note.xml文件结构:
George John Reminder Don't forget the meeting!a John Reminder Don't forget the meeting!George John Reminder Don't forget the meeting!
利用js将xml输出到div中:
www.jb51.net js读取xml
.aaaa{width: 30%;height: 50px;line-height: 50px;text-align: center;border: 1px solid darkblue;float: left;}
运行效果:
PS:这里再为大家提供几款关于xml操作的在线工具供大家参考使用:
在线XML/JSON互相转换工具:
http://tools.jb51.net/code/xmljson
在线格式化XML/在线压缩XML:
http://tools.jb51.net/code/xmlformat
XML在线压缩/格式化工具:
http://tools.jb51.net/code/xml_format_compress
XML代码在线格式化美化工具:
http://tools.jb51.net/code/xmlcodeformat
更多关于Javascript相关内容可查看本站专题:《Javascript操作XML文件技巧总结》、《Javascript文件与目录操作技巧汇总》、《Javascript中ajax操作技巧总结》、《Javascript错误与调试技巧总结》及《Javascript数据结构与算法技巧总结》
希望本文所述对大家Javascript程序设计有所帮助。



