%
if request.QueryString("dc")="1" then'xhr請求則輸出當前時間并停止繼續(xù)執(zhí)行
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'發(fā)起異步請求
xmlServerHttp.send
While xmlServerHttp.readyState > 4'注意這里要判斷xhr對象的狀態(tài),如果不為4則等待1000ms,要不最下面那句會報上面貼出來的錯誤
xmlServerHttp.waitForResponse 1000
Wend