发送 XML 文档到服务器 ASP 页面,分析传回结果
编辑下面的代码,然后点击查看运行效果按钮,右侧显示代码修改后的运行结果
<html> <body> <script type="text/javascript"> xmlHttp=null; if (window.XMLHttpRequest) {// code for IE7, Firefox, Opera, etc. xmlHttp=new XMLHttpRequest(); } else if (window.ActiveXObject) {// code for IE6, IE5 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlHttp!=null) { xmlHttp.open("GET", "/xml/try/note.xml", false); xmlHttp.send(null); xmlDoc=xmlHttp.responseText; xmlHttp.open("POST", "/xml/try/xmlhttp-open.asp", false); xmlHttp.send(xmlDoc); document.write(xmlHttp.responseText); } else { alert("Your browser does not support XMLHTTP."); } </script> </body> </html>
运行结果:
上一个示例:
XMLHttpRequest 对象获取 XML 数据,Aysnc=false
下一个示例:
XML 数据岛
XML 示例
-
W3C HTML
- 在线测试工具 V1.0