Javascript 如何从这个xml页面检索数据

Javascript 如何从这个xml页面检索数据,javascript,ajax,xml,response,Javascript,Ajax,Xml,Response,因此,我试图从请求中获取要显示的所有数据,但我无法得到响应,因为它一直给我[object XMLDocument],如果我使用.responseText,则为空 这是请求URL 这是网站 这是我正在使用的代码 <button onclick="loadXML()">Run</button> <p id="output"></p> <script> function loadXML() { var xmlhttp = new XM

因此,我试图从请求中获取要显示的所有数据,但我无法得到响应,因为它一直给我[object XMLDocument],如果我使用.responseText,则为空

这是请求URL

这是网站

这是我正在使用的代码

<button onclick="loadXML()">Run</button>

<p id="output"></p>

<script>
function loadXML() {
  var xmlhttp = new XMLHttpRequest();
  xmlhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      document.getElementById("output").innerHTML = this.responseXML;
    }
  };
  xmlhttp.open("GET", "http://www.omdbapi.com/?t=Chef&plot=full&r=xml", true);
  xmlhttp.send();
}
</script>
运行

函数loadXML(){ var xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=函数(){ if(this.readyState==4&&this.status==200){ document.getElementById(“输出”).innerHTML=this.responseXML; } }; open(“GET”http://www.omdbapi.com/?t=Chef&plot=full&r=xml“,对); xmlhttp.send(); }

我所需要的只是一个返回的响应,我可以从那里开始,但我尝试的一切都不起作用://

谢谢你的关注,但我找到了答案。我正在接收HTML标记,当我输出这些标记时,它们不会显示,因为它们作为HTML标记回声。数据就隐藏在那里。为了解决这个问题,我只保存了文件,或者可以在输出之前对其进行清理