我是xml的新手我在xml文件上阅读了教程(w3schools.com)我找到样本来读取和打印xml文件这段代码:
<p id="demo"></p>
<script>
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myFunction(this);
}
};
xhttp.open("GET", "books.xml", true);
xhttp.send();
function myFunction(xml) {
var x, i, txt, xmlDoc;
xmlDoc = xml.responseXML;
txt = "";
x = xmlDoc.getElementsByTagName("title");
for (i = 0; i < x.length; i++) {
txt += x[i].childNodes[0].nodeValue + "<br>";
}
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>
但是我不知道在xclipse上将我的xml文件放在动态Web项目上的哪个位置?
在指令xhttp.open("GET", "books.xml", true);
上方的代码中
我必须把books.xml文件放在哪里?