JS使用ajax从xml文件动态获取数据显示的方法

本文实例讲述了JS使用ajax从xml文件动态获取数据显示方法分享给大家供大家参考。具体分析如下:

下面的JS代码通过ajax检索xml文件内容动态展示到网页,真个页面无刷新

rush:js;">

xml文件内容如下

rush:xml;"> Empire Burlesque Bob Dylan USA Columbia 10.90 1985 Hide your heart Bonnie Tyler UK CBS Records 9.90 1988 Greatest Hits Dolly Parton USA RCA 9.90 1982 Still got the blues Gary Moore UK Virgin records 10.20 1990 Eros Eros Ramazzotti EU BMG 9.90 1997 One night only Bee Gees UK polydor 10.90 1998 Sylvias Mother Dr.Hook UK CBS 8.10 1973 Maggie May Rod Stewart UK Pickwick 8.50 1990 Romanza Andrea Bocelli EU polydor 10.80 1996 When a man <a href="https://www.jb51.cc/tag/lov/" target="_blank" class="keywords">lov</a>es a woman Percy Sledge USA Atlantic 8.70 1987 Black angel Savage Rose EU Mega 10.90 1995 1999 Grammy No<a href="https://www.jb51.cc/tag/mine/" target="_blank" class="keywords">mine</a>es Many USA Grammy 10.20 1999 For the good times Kenny Rogers UK Mucik Master 8.70 1995 Big Willie style Will Smith USA Columbia 9.90 1997 Tupelo Honey Van Morrison UK polydor 8.20 1971 Soulsville Jorn Hoel norway WEA 7.90 1996 The very best of Cat Stevens UK Island 8.90 1990 Stop Sam brown UK A and M 8.90 1988 Bridge of Spies T'Pau UK siren 7.90 1987 Private Dancer Tina Turner UK Capitol 8.90 1983 Midt om natten Kim larsen EU Medley 7.80 1983 Pavar<a href="https://www.jb51.cc/tag/ott/" target="_blank" class="keywords">ott</a>i <a href="https://www.jb51.cc/tag/gal/" target="_blank" class="keywords">gal</a>a Concert Luciano Pavarotti UK DECCA 9.90 1991 The dock of the bay Otis Redding USA Atlantic 7.90 1987 Picture book Simply Red EU Elektra 7.20 1985 Red The Communards UK London 7.80 1987 Unchain my heart Joe Cocker USA EMI 8.20 1987

希望本文所述对大家的javascript程序设计有所帮助。

相关文章

IE6是一个非常老旧的网页浏览器,虽然现在很少人再使用它,但...
PHP中的count()函数是用来计算数组或容器中元素的个数。这个...
使用 AJAX(Asynchronous JavaScript and XML)技术可以在不...
Ajax(Asynchronous JavaScript and XML)是一种用于改进网页...
本文将介绍如何通过AJAX下载Excel文件流。通过AJAX,我们可以...
Ajax是一种用于客户端和服务器之间的异步通信技术。通过Ajax...