我要做一个接口,发出HTTP请求,然后得到XML,然后用DOM进行解析,再返回一个页面。参考MSDN后,想弄清下面的帮助中的具体意思,
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
xmlHTTP.open("GET","http://myserver/save.asp", false); //该句中URL中save.asp是要请求的页面,该页的内容是什么?
xmlHTTP.send(xmlDoc) //xmlDoc是什么类型的东东?
The following code belongs on the server.
1 xmlDoc.load(Request);
2``` //这是不是就是save.asp中的内容
3
4另外一个帮助:
5xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
6xmlhttp.open("GET", "http://localhost/sample.xml", false);
7xmlhttp.send();
8alert(xmlhttp.responseXML.xml);//该句就是返回我要的XML文件?也就是sample.xml?responseXML和responseText有什么区别?
9
10\---------------------------------------------------------------
11
12xmlHTTP.open("GET","http://myserver/save.asp", false);
13save.asp的内容根据save.asp里面的程序决定.
14\---------------------------------------------------------------
15
16responseText:返回文本格式
17responseXML:返回xml格式
18其它还有
19responseBody
20responseStream等