<script type="text/javascript"> var wait=60; function time(o) { if (wait == 0) { //o.attr("background-color", "#fff"); o.removeAttribute("disabled"); o.value="获取验证码"; wait = 60; } else { $(o).attr("disabled",true); o.value="重新发送(" + wait + ")"; wait--; setTimeout(function() { time(o) }, 1000) } } function send(obj) { var phone =$('#phone').val(); //获取手机号码 $.ajax({ url:"", type: "post/get", data: {"pnone":phone}, dataType: "json", success:function(data){ if(data.status==1){ $(obj).attr("disabled",true); }else{ layer.alert(data.msg); }; } }); } document.getElementById("btn1").onclick=function(){send(this);time(this);} ; </script>
发送短信验证码
最新推荐文章于 2024-07-19 14:44:09 发布