javascript:
var xmlDoc;
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else // Internet Explorer 5/6
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET","cd_catalog",false);
xhttp.send("");
xmlDoc=xhttp.responseXML;
var x=xmlDoc.getElementsByTagName("CD");
function show(i)
{
artist=(x[i].getElementsByTagName("image")[0].childNodes[0].nodeValue);
//title=(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
txt="Artist: "+artist;
document.getElementById("show").innerHTML=txt;
}
No comments:
Post a Comment