- UID
- 76
- 帖子
- 115
- 精华
- 0
- 贡献
- 0
- 推广
- 0
- 有效BUG
- 0
- 注册时间
- 2005-2-24
|
http://forum.maxthon.com/uploads/lockuptest.htm
<html>
<head>
<title>AJAX 假死测试</title>
<meta http-equiv="content-type" c>
<script language="JavaScript">
try{var xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}
catch(e){var xmlHttp=new XMLHttpRequest()}
var sText='';
function Run(){
sText='';
document.getElementById('status').innerHTML='正在下载资料 (假死)';
setTimeout('Start()',100);
}
function Start(){
try{
var i=0;
while(i<10){
Test();
i++;
}
if(sText!=''){
document.getElementById('status').innerHTML='完成下载资料 (假死结束)';
}
else{
document.getElementById('status').innerHTML='不能下载资料,测试失败';
}
}
catch(e){
document.getElementById('status').innerHTML='不能下载资料,测试失败';
}
}
function Test(){
var random=Math.round(Math.random()*660)
var url='http://forum.maxthon.com/forum/index.php?showtopic=1036&st='+random;
xmlHttp.open("GET",url,false);
xmlHttp.send(null);
sText+=xmlHttp.responseText;
}
function Check(){
alert(sText);
}
</script>
</head>
<body>
<button onclick=Run()>测试</button>
<button onclick=Check()>查看资料</button><br><br>
<div id=status></div>
</body>
</html>
|
|