代码编辑器:
x
1
2
<html>
3
<body>
4
<script>
5
if (window.XMLHttpRequest)
6
{
7
xmlhttp=new XMLHttpRequest();
8
}
9
10
xmlhttp.open("GET","/static/media/books.xml",false);
11
xmlhttp.send();
12
xmlDoc=xmlhttp.responseXML;
13
14
txt=xmlDoc.getElementsByTagName("title")[0].getAttribute("lang");
15
document.write(txt);
16
</script>
17
</body>
18
</html>