W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <script type="text/vbscript"> dim xmlhttp function loadXMLDoc(url) set xmlhttp=createObject("Microsoft.XMLHTTP") xmlhttp.onreadystatechange=getRef("state_Change") call xmlhttp.open("GET",url,true) call xmlhttp.send() end function function state_Change() if xmlhttp.readyState=4 then if xmlhttp.status=200 then alert("XML data OK") document.getElementById("A1").innerText=xmlhttp.status document.getElementById("A2").innerText=xmlhttp.statusText document.getElementById("A3").innerText=xmlhttp.responseText else alert("Problem retrieving XML data:" & xmlhttp.statusText) end if end if end function </script> </head> <body onload="loadXMLDoc('/example/xmle/note.xml')"> <h2>Using the HttpRequest Object</h2> <p><b>status:</b> <span id="A1"></span> </p> <p><b>status text:</b> <span id="A2"></span> </p> <p><b>response:</b> <br /><span id="A3"></span> </p> </body> </html>