The code copy is as follows:
<script type="text/javascript" language="javascript">
var wait = 60;
function change() {
$o = $("#J_refresh_checkcode");
if(wait == 0) {
$o.removeAttr("disabled");
$o.html("Can't see clearly? Change another one");
wait = 60;
} else {
$o.attr("disabled", true);
$o.attr("font-color", "gray");
$o.html(wait + "can be re-geted in seconds");
wait--;
if(wait == 59) {
var imgNode = document.getElementById("vimg");
imgNode.src = "../../AjaxServer/CheckCodePic.ashx?t=" + (new Date()).valueOf(); // Add a time parameter here to prevent browser cache problems
$("#J_checkcode_tip").addClass("hide");
$("#J_checkcode_tip>div").html("");
$("#<%=hidPicMessage.ClientID%>").val("");
}
setTimeout(function() {
change()
},
1000)
}
}</script>
Then the html is as follows:
The code copy is as follows:
<div>
<span>Verification Code</span>
<input name="checkCode" id="J_checkcode_input" onmousedown="ClearCodeMessage()" type="text" maxlength="6" autocomplete="off" onblur="CheckCode()" />
<img src="../../AjaxServer/CheckCodePic.ashx" id="vimg" style="float:left;margin:-1px 0 0 3px"/>
<a id="J_refresh_checkcode" onclick="change()">I can't see clearly, change another one</a>
<div id="J_checkcode_tip">
<div>
<i></i>
<div>
</div>
</div>
</div>
</div>