Home  >  Article  >  Web Front-end  >  jQuery parses xml files_jquery

jQuery parses xml files_jquery

WBOY
WBOYOriginal
2016-05-16 18:48:281093browse
复制代码 代码如下:



jquery xml解析













city.xml文件
复制代码 代码如下:




武汉
黄石
宜昌
天门


邵阳
长沙
岳阳


广州
深圳



其实主要是注意怎样在html界面上解析xml文件,格式就是
复制代码 代码如下:



就是用$.ajax()调用xml文件的内容。然后$.each()进行循环操作,基本思想就是这样的,成功之后去执行success这个回调函数。这里的xml文件是用来存储数据的,相当于在数据库中读取文件。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn