消息关闭
    暂无新消息!
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="format-detection" content="telephone=no"><title>问答测试</title><script type="text/javascript">var yyuc_jspath = "./tpl/static/problem";</script><script type="text/javascript" src="./tpl/static/problem/js/jquery.js"></script><script type="text/javascript" src="./tpl/static/problem/js/yyucadapter.js"></script><link type="text/css" rel="stylesheet" href="./tpl/static/problem/css/war.css"></head><body style="background:#feae05;"><div class="wrapper"><img class="bg" src="./tpl/static/problem/image/bg_exam.jpg"><img class="bg1" src="./tpl/static/problem/image/bg_exam1.jpg" style="top:372px;height:50%"><div class="top"><div class="time"><span id="jsf">30</span>:<span id="jsm">0</span></div><div class="index">第<strong>9</strong>题</div><div class="score">积分:<span style="color: red;font-size: 16px;line-height: 30px;">1</span></div></div><div class="question"><div class="title" style="max-height:100%">安全宣传教育的最终目的是(  )。</div><div class="options"><div class="option" data-value="79107"><img class="oimg" src="./tpl/static/problem/image/option_bg.png"><img class="oimg-sel" src="./tpl/static/problem/image/option_sel_bg.png"><div class="text"><div class="i">1、</div><div class="otext">提高干部职工的安全生产素质</div></div></div><div class="option" data-value="79108"><img class="oimg" src="./tpl/static/problem/image/option_bg.png"><img class="oimg-sel" src="./tpl/static/problem/image/option_sel_bg.png"><div class="text"><div class="i">2、</div><div class="otext">树立全局观</div></div></div><div class="option" data-value="79109"><img class="oimg" src="./tpl/static/problem/image/option_bg.png"><img class="oimg-sel" src="./tpl/static/problem/image/option_sel_bg.png"><div class="text"><div class="i">3、</div><div class="otext">提高科技水平</div></div></div><div class="option" data-value="79110"><img class="oimg" src="./tpl/static/problem/image/option_bg.png"><img class="oimg-sel" src="./tpl/static/problem/image/option_sel_bg.png"><div class="text"><div class="i">4、</div><div class="otext">其他</div></div></div></div></div></div><script type="text/javascript">$(function(){
$('.option').click(function(){
$('.option').unbind("click");
clearInterval(window.djs);
checkans($(this).attr('data-value'));
});
window.djs = setInterval(function(){
var jsm = parseInt($('#jsm').text());
var jsf = parseInt($('#jsf').text());
if(jsm>0){
jsm-=1;
$('#jsm').text(jsm+'');
}else if(jsf>0){
jsf-=1;
$('#jsm').text('99');
$('#jsf').text(jsf+'');
}else{
checkans('0');
clearInterval(window.djs);
}

},0);

});

checkans(1);function checkans(ans){
ajax("http://weixin.111.com/index.php?g=Wap&m=Problem&a=add_rank&token=oihbri1497279853&wecha_id=oi-MHw0DfEHXDQY-yt3S8X_tI8ZY&id=879&qid=23756",{oid:78867,start:'1498319227'},function(m){
if(m=='ok'){
tusi('恭喜回答正确');
}else if(m=='no'){
tusi('回答错误');
}else if(m=='out'){
tusi('答题超时');
}
setTimeout(function(){
window.location.reload();
},0);

});
}
</script></body></html>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
代码就是这样的,我现在在function checkans(ans),前面加了checkans(1);让代码自动答题,可是,可是速度还是比较慢,为什么????
我百度了一下,好像JS的time,设置是0的话,其实还要一秒多次执行,是吗??

为什么啊???我设置自动答题,速度看起来很快了,但是还是慢,别人手动都比我快,为什么

1个回答

︿ 1
有什么办法可以更快执行呢????比如checkans(1);加在什么地方,或者什么形式的添加,才可以更快呢???这个问题苦恼我好几天了。

我不好意思经常发帖提问,哎,我也是有自尊心的,我一直风发图强百度呢

别小瞧我啊,我最近学nodejs呢。,就这水平,我也想做个高手,人总是要有目标的对不对啊