When ASP uses Msxml2.serverxmlhttp to send requests asynchronously, it is necessary to be aware of whether the Msxml2.serverxmlhttp object's readystate is 4, and if you do not judge the properties of the object directly, such as ResponseText, the following error occurs:
Copy Code code as follows:
Msxml3.dll error ' 8000000a '
The data required to complete this operation is not yet available.
/a.asp, Line 18
ASP uses Msxml2.serverxmlhttp to send the request source code asynchronously:
Copy Code code as follows:
<%
If request. QueryString ("dc") = "1" Then ' XHR request outputs the current time and stops execution
Response. Write now
Response. End
End If
Dim xmlserverhttp
Set xmlserverhttp = Server.CreateObject ("MSXML2. ServerXMLHTTP ")
Xmlserverhttp.open "Get", "http://root.jb51.net/a.asp?dc=1", true ' initiates an asynchronous request
Xmlserverhttp.send
While Xmlserverhttp.readystate <> 4 ' note here to determine the state of the XHR object, if not 4 then wait for 1000ms, or the bottom of the sentence will be reported above the error
Xmlserverhttp.waitforresponse 1000
Wend
Response.ContentType = "Text/html"
Response.Write "Receiver Page:" & Xmlserverhttp.responsetext & "<br/>"
%>