js控制当再次点击按钮时的间隔时间
<scripttype="text/javascript"language="javascript">
varwait=60;
functionchange(){
$o=$("#J_refresh_checkcode");
if(wait==0){
$o.removeAttr("disabled");
$o.html("看不清?换一张");
wait=60;
}else{
$o.attr("disabled",true);
$o.attr("font-color","gray");
$o.html(wait+"秒后可重新获取");
wait--;
if(wait==59){
varimgNode=document.getElementById("vimg");
imgNode.src="../../AjaxServer/CheckCodePic.ashx?t="+(newDate()).valueOf();//这里加个时间的参数是为了防止浏览器缓存的问题
$("#J_checkcode_tip").addClass("hide");
$("#J_checkcode_tip>div").html("");
$("#<%=hidPicMessage.ClientID%>").val("");
}
setTimeout(function(){
change()
},
1000)
}
}</script>
则html如下:
<div> <span>验证码</span> <inputname="checkCode"id="J_checkcode_input"onmousedown="ClearCodeMessage()"type="text"maxlength="6"autocomplete="off"onblur="CheckCode()"/> <imgsrc="../../AjaxServer/CheckCodePic.ashx"height="28"id="vimg"alt=""style="float:left;margin:-1px003px"/> <aid="J_refresh_checkcode"onclick="change()">看不清,换一张</a> <divid="J_checkcode_tip"> <div> <i></i> <div> </div> </div> </div> </div>
热门推荐
10 新年门口花束祝福语简短
11 盘锦结婚祝福语大全简短
12 父母生日祝福语 简短独特
13 家庭恩爱祝福语简短英文
14 高考俄语祝福语大全简短
15 虎年祝福语 诗句唯美简短
16 生日婚礼祝福语简短精辟
17 虎年喝酒拜年祝福语简短
18 教师闺蜜祝福语简短