运行 ❯
获取您自己的网站
×
更改方向
保存代码
更改主题,暗色/亮色
前往 Spaces
<!DOCTYPE html> <html> <body> <h2>The XMLHttpRequest Object</h2> <p>The getAllResponseHeaders() function returns all the header information of a resource, like length, server-type, content-type, last-modified, etc:</p> <pre id="demo"></pre> <script> const xhttp = new XMLHttpRequest(); xhttp.onload = function() { document.getElementById("demo").innerHTML = this.getAllResponseHeaders(); } xhttp.open("GET", "ajax_info.txt"); xhttp.send(); </script> </body> </html>