<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Scriptsrc= "Html/js/jquery-1.4.1.min.js"type= "Text/javascript"></Script><Scripttype= "Text/javascript">varintervalobj;//timer variable, control timevarCount= 5; //interval function, 1 second executionvarCurcount;//current number of seconds remainingfunctionSendMessage () {Curcount=count; //Set button effect to start timing $("#btnSendCode"). attr ("Disabled", "true"); $("#btnSendCode"). Val ("Please check the" +Curcount+ "Enter the verification code in seconds"); Intervalobj=Window.setinterval (Setremaintime, +); //start Timer, execute once in 1 seconds //send processing data to the background$.ajax ({type:"POST", //transfer by postDataType:"text", //data format: JSONURL:'login.ashx', //Destination AddressData:"dealtype=" +Dealtype+"&uid=" +UID+ "&code=" +code, Error:function(XMLHttpRequest, Textstatus, Errorthrown) {}, Success:function(msg) {}});}//Timer handler functionfunctionSetremaintime () {if(Curcount== 0) {window.clearinterval (intervalobj);//Stop Timer $("#btnSendCode"). Removeattr ("Disabled");//Enable button $("#btnSendCode"). Val ("Resend Verification Code"); } Else{Curcount--; $("#btnSendCode"). Val ("Please check the" +Curcount+ "Enter the verification code in seconds"); } }</Script></Head><Body> <inputID= "Btnsendcode"type= "button"value= "Send Verification Code"onclick= "SendMessage ()" /></P></Body></HTML>
Jquery implementation of the Click button after the countdown effect, more for the implementation of mobile phone verification Code, email Verification Code