how to displaying xml data in html page?

neubbonaenats

New Member
i am trying to read the xml file but somehow i am getting problem : xml data can't displayed \[code\]<!DOCTYPE html><html><body><script>var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");xmlhttp.open("GET","http://data.bmkg.go.id/gempadirasakan.xml",false);xmlhttp.send();xmlDoc=xmlhttp.responseXML; document.write("<table border='1'>");var x=xmlDoc.getElementsByTagName("Gempa");for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x.getElementsByTagName("Tanggal")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x.getElementsByTagName("Magnitude")[0].childNodes[0].nodeValue); document.write("</td></tr>"); }document.write("</table>");</script></body></html>\[/code\]how i can display it???
 
Back
Top