简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <html> <body> <script> if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } xmlhttp.open("GET","/static/media/books.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; txt=xmlDoc.getElementsByTagName("title")[0].getAttribute("lang"); document.write(txt); </script> </body> </html>
运行结果: