XMLHttpRequest中文参考手册.pdf
XMLHttpRequest提提提户端端http服务器器讯的协协Example下面的代码是在JScript中创建一个XmlhTtp对象并从服务器请求一个XML文档。服务器返回XML文档并显示var xmlHttpReq = new ActiveXObject("MSXML2.XMLHTTP.3.0"); xmlHttpReq.open("GET", "http://localhost/books.xml", false); xmlHttpReq.send(); alert(xmlHttpReq.responseText);在非IE的浏览器中,需要用new XmlHttpreQueSt()来创建对象,如下: var xmlHttpReq = new XMLHttpRequest(); xmlHttpReq.open("GET", "http://localhost/books.xml", false); xmlHttpReq.send(); alert(xmlHttpReq.responseText);
763.88KB
文件大小:
评论区