zoukankan      html  css  js  c++  java
  • 九、获取验证码

    验证码倒计时函数

        var wait = 60;

                                function time(o) {

                                       if(wait == 0) {

                                              o.removeAttribute("disabled");

                                              o.value = "获取验证码";

                                              wait = 60;

                                       } else {

                                              o.setAttribute("disabled", true);

                                              o.value = "重新发送(" + wait + ")";

                                              o.style.backgroundColor = '';

                                              wait--;

                                              setTimeout(function() {

                                                            time(o)

                                                     },

                                                     1000)

                                       }

                                }

           $("#btn").click(function(){

                         phone1 = $("#phone1").val();

                         if(checkPhone(phone1)){

                                time(this);

                                $.ajax({

                                       url: "http://ezist.cn/api/verificationCodes",

                                 type: 'post',

                                 dataType: "json",

                                 data: {tel:phone1,verify:'true'},

                                 success: function(data) {

                                              mui.toast("验证码已发送,请注意查收。");

                                              mes = data.verification_key;

                                 },

                                 error: function (data) {

                                     mui.toast("验证码请求失败");

                                 }

                                });

                         }

                  })

  • 相关阅读:
    用友U8存货分类通过DataTable生成EasyUI Tree JSON
    脚本加密与解密
    CKFinker 2.5.0.1 去demo标示
    C#压缩图片时保留原始的Exif信息
    Newtonsoft.Json转换强类型DataTable错误:Self referencing loop detected with type ......
    Access无法启动应用程序,工作组信息文件丢失,或是已被其他用户已独占方式打开
    C#获取邮件客户端保存的邮箱密码
    网站ASHX不执行故障
    水晶报表打印时出现:出现通信错误 将停止打印
    UILabel居上对齐居下对齐类别扩展
  • 原文地址:https://www.cnblogs.com/deng-jie/p/9104264.html
Copyright © 2011-2022 走看看