0
你好,我是新的XML HTTP请求。 和我想加载一个XML文件的代码,但没有得到所需的结果。XMLhttp请求未加载
code is :
`<script>
if (window.XMLHttpRequest)
{
var xhttp=new XMLHttpRequest();
}
var url="../src/employee.xml";
xhttp.open('GET',url,true);
xhttp.send();
xmlDoc=xhttp.responseXML;
document.write("XML document loaded into an XML DOM Object.");
</script>
</body>
</html>`
员工在这 <?xml version="1.0" encoding="utf-8"?> <employee> <branch="cse"> <name>Rahul</name> <age>21</age> </branch> </employee>
预先感谢您src文件夹中的XML文件。
没有你尝试没有.. ? – 2013-03-21 20:22:29
是的,我试过它不工作。 – Rahul 2013-03-21 20:27:13
经过一番测试,我发现发送功能不工作。不知道错误是什么,但如果有人告诉我会很高兴 – Rahul 2013-03-21 22:12:01