填写手机号码后,如何快速获取验证码呢?
- 内容介绍
- 文章标签
- 相关推荐
本文共计91个文字,预计阅读时间需要1分钟。
使用手机倒计时验证码验证,代码如下:
javascript(function(){ // ...})()
gistfile1.txt// 手机倒计时验证码 $(function(){ $("#btn").click(function(){ if($('#phone').val() == null || $('#phone').val() =="" || isPhoneNo($.trim($('#phone').val())) == false){ $("#btn").attr("disabled","disabled"); }else{ $("#btn").removeAttr("disabled"); var codename = $(".codename").val(); $.ajax({ type: 'POST', url: 'my.php?mid=10&action=post_code', dataType: 'json', data:{mobile:codename}, success: function(data){ console.log(data); }, error: function(){ console.log("error"); } }); timerInt(); } }) });
本文共计91个文字,预计阅读时间需要1分钟。
使用手机倒计时验证码验证,代码如下:
javascript(function(){ // ...})()
gistfile1.txt// 手机倒计时验证码 $(function(){ $("#btn").click(function(){ if($('#phone').val() == null || $('#phone').val() =="" || isPhoneNo($.trim($('#phone').val())) == false){ $("#btn").attr("disabled","disabled"); }else{ $("#btn").removeAttr("disabled"); var codename = $(".codename").val(); $.ajax({ type: 'POST', url: 'my.php?mid=10&action=post_code', dataType: 'json', data:{mobile:codename}, success: function(data){ console.log(data); }, error: function(){ console.log("error"); } }); timerInt(); } }) });

