<script type="text/javascript" language="javascript"> var wait = 60; function change() { $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) { var imgNode = document.getElementById("vimg"); imgNode.src = "../../AjaxServer/CheckCodePic.ashx?t=" + (new Date()).valueOf(); // 这里加个时间的参数是为了防止浏览器缓存的问题 $("#J_checkcode_tip").addClass("hide"); $("#J_checkcode_tip>div").html(""); $("#<%=hidPicMessage.ClientID%>").val(""); } setTimeout(function() { change() }, 1000) } }</script>
则 html如下:
<div> <span>验证码</span> <input onmousedown="ClearCodeMessage()" type="text" maxlength="6" autocomplete="off" onblur="CheckCode()" /> <img src="" alt=""/> <a>看不清,换一张</a> <div> <div> <i></i> <div> </div> </div> </div> </div>
您可能感兴趣的文章: