页面效果,给手机发送验证码
<!DOCTYPEhtml><htmllang="en"><head><metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"><title>定时发送验证码</title><scripttype="text/javascript">varwait=5;functionsend(o){if(wait==5){//向服务器发送请求,给手机发送验证码//$.post("<%=path%>/simple/user/sendCode/mobile",//{//"mobile":"${user.mobile}",//"number":2//},//function(data){//if(data,message=="success"){//alert("验证码发送成功,请注意查收!");//}else{//alert("验证码发送失败,请稍后重试!");//}//});}if(wait==0){o.removeAttribute("disabled");o.value="手机获取";wait=5;}else{o.setAttribute("disabled",true);o.value=wait+"s后可重新发送";wait--;setTimeout(function(){send(o);},1000)}}</script></head><body><labelfor="mobile">手机号:</label><inputid="mobile"/><inputtype="submit"class="sub_verify"onclick="send(this);"value="手机获取"/></html>
效果:
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。