Share the method of reading the node data using JavaScript to read the XML file.
Read the node data, another case is to read the node property data.
varObjlength =NULL;varxmlHttp;varstrURL = "";functionAjaxrequst () {if(window. ActiveXObject) {xmlHttp=NewActiveXObject ("Microsoft.XMLHTTP");}Else{xmlHttp=NewXMLHttpRequest ();}Try{strURL= "/data/rdzz.xml"; Xmlhttp.onreadystatechange=Loadxmlfile;xmlhttp.open ("GET", strURL + "? Time=" + (NewDate ()). GetTime (),true); Xmlhttp.send (NULL);}Catch(e) {}}functionLoadxmlfile () {varContent = "";if(Xmlhttp.readystate = = 4) {if(Xmlhttp.status = = 200) {varXmlDOM =Xmlhttp.responsexml;varXmlRoot =xmldom.documentelement;Try {varObjlength = Xmlroot.getelementsbytagname ("Item"); for(vari = 0; i < objlength.length; i++) {varElementtitle = Objlength[i].getelementsbytagname (' newstitle ') [0];varElementtime = Objlength[i].getelementsbytagname (' newstime ') [0];varElementurl= objlength[i].getelementsbytagname (' Newsurl ') [0];//Lastvalue = Objlength[i].getattribute ("Lastvalue")//prediction = Objlength[i].getattribute ("prediction")//Actual = Objlength[i].getattribute ("Actual")//importance = Objlength[i].getattribute ("importance")//newstime = Objlength[i].getattribute ("Newstime")vartitle = Elementtitle.textcontent | |Elementtitle.text;varTime = Elementtime.textcontent | |Elementtime.text;varurl = elementurl.textcontent | |elementurl.text;content+ = "<li><dl><dd>" + Time + "</dd><dd><a href=" + URL + "' target= ' blank ' >" + title + "</a></dd></dl></li>";} document.getElementById ("Newsinfo"). InnerHTML =content;}Catch(e) {}} www.jbxue.com}}</script>