//倒计时 function resetCode(){ $('.J_getCode').hide(); $('.J_second').html('60'); $('.J_resetCode').show(); var second = 60; var timer = null; timer = setInterval(function(){ second -= 1; if(second >0 ){ $('.J_second').html(second); }else{ clearInterval(timer); $('.J_getCode').show(); $('.J_resetCode').hide(); } },1000); }; $(function () { //点击发送验证码 var isPhone = 1; $(".J_getCode").click(function(){ isPhone = 1; $.post('url',{ },function(result){ if(result.success){ resetCode(); //倒计时 showMsgSuccess("获取验证码成功"); }else{ showMsgError("获取验证码成功"); } },'json'); }); })
js 发送短信 倒计时
最新推荐文章于 2022-07-09 14:06:57 发布