zoukankan      html  css  js  c++  java
  • AJAX 请求 XML 格式的数据


    <script>

    var xhr = new XMLHttpRequest();
    xhr.open('GET', 'xml.php');
    xhr.send();
    xhr.onreadystatechange = function () {
    if (this.readyState !== 4) return;
    // this.responseXML 专门用于获取服务端返回的 XML 数据,操作方式就是通过 DOM 的方式操作
    // 但是需要服务端响应头中的 Content-Type 必须是 application/xml
    console.log(this.responseXML.documentElement.children[0].innerHTML);
    console.log(this.responseXML.documentElement.getElementsByTagName('name')[0])
    }

    </script>
  • 相关阅读:
    MD5 Hashing in Java
    Caching in Presto
    ORC 文件存储格式
    Presto 性能优化点
    数据分页问题
    ES
    ES
    ES
    ES
    ES
  • 原文地址:https://www.cnblogs.com/lujieting/p/10291275.html
Copyright © 2011-2022 走看看