求助 JS clearTimeout 无效

areos_ areos_ 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
function update(url,odj){
var ajax = ((typeof XMLHttpRequest == 'function') ? new XMLHttpReuest() : new ActiveXObject('Microsoft.XMLHTTP'));
ajax.open('get',url,true);
ajax.onreadystatechange = function(){
var flag = false,time;
if(ajax.readyState == 4 && ajax.status == 200){
if(ajax.responseText != null){
flag = true;
clearTimeout(time);
$('Progress').style.display = 'none';
$('Progress').style.backgroundColor = '';
}
}else{
(function(){
$('Progress').style.display = 'block';
with($('Progress').firstChild.style){
if(parseInt(marginRight) > 0){
marginRight = parseInt(marginRight) - 1;
}else{
$('Progress').style.backgroundColor = backgroundColor;
marginRight = 125;
backgroundColor = backgroundColor == '#fff' ? '#600' : '#fff';
}
}
time = setTimeout(arguments.callee,10);
})();
}
}
ajax.send(null);
}


无法结束setTimeout 求各位大神看看那里的问题
...全文

相关推荐

评论 12
收藏 已收藏
分享
返回顶部
areos_
JavaScript 87,984 成员 224,681 内容