Go homepage(回首页)
Upload pictures (上传图片)
Write articles (发文字帖)

The author:(作者)归海一刀
published in(发表于) 2014/3/16 2:53:28
XMLHTTP异步获取返回值的代码超时测试(AJAX)_[AJAX教程]

XMLHTTP异步获取返回值的代码超时测试(AJAX)_[AJAX教程]

















客户端文件,请修改文件名为:test_2.htm






xmlhttp异步的例子:
URL:
onclick= "getXML()" type= "button" value= "得到源代码">

onclick= "if(xh && xh.responseText) {alert(xh.responseText);oDiv.innerHTML=xh.responseText} " type= "button" value= "显示源代码 " >










服务器端文件,请修改文件名为:test_s.asp




<%
dim i
dim r
dim t
dim lngGetI


lngGetI=request.querystring("geti")




on error resume next
lngGetI=clng(lngGetI)
if err<>0 then
response.write "GetError: not isnumber()"
response.end()
end if




if lngGetI<0 or lngGetI>500000 then
lngGetI=10000
end if




response.write "Run Repeat At:" & lngGetI & "
"





t=timer
for i=1 to lngGetI
r = r & i
if i mod 20 = 0 then
r= r & "a
"
end if
next




response.write "run timer:" & cdbl(timer()-t) & "
"
response.write r





%>

























If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)





QQ:154298438
QQ:417480759