responseText

Xmlhttp object reference
XMLHttpRequest object XMLHttpRequest member onreadystatechange readyState ResponseBody responsestream responseText responsexml status statustext about getallresponseheaders getresponseheader open send setrequestheader responseText
Return response information as a string
grammar
strValue = oXMLHttpRequest.responseText;
Example
var xmlhttp = new ActiveXObject(“Msxml2.XMLHTTP.3.0”);
xmlhttp.open(“GET”, “http://localhost/books.xml”, false);
xmlhttp.send();
alert(xmlhttp.responseText);
Remarks
Variable, which is read-only and returns response information as a string.
Xmlhttp attempts to decode the response information into a Unicode string. By default, xmlhttp sets the encoding of the response data as UTF-8. If the data returned by the server has a BOM (byte order mark), xmlhttp can decode any ucs-2 (big or little endian) or ucs-4 data. Note that if the server returns an XML document, this property does not process the encoding declaration in the XML document. You need to use the responsexml for processing.
Reference resources
ResponseBody property
ResponseText property
Responsexml attribute

发布了133 篇原创文章 · 获赞 191 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/blog_programb/article/details/105616960