• 九、获取验证码


    验证码倒计时函数

        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("验证码请求失败");

                                 }

                                });

                         }

                  })

  • 相关阅读:
    HEVC的參考队列解码
    【linux高级程序设计】(第十四章)TCP高级应用 2
    【linux高级程序设计】(第十四章)TCP高级应用
    【linux高级程序设计】(第十三章)Linux Socket网络编程基础 4
    【linux高级程序设计】(第十三章)Linux Socket网络编程基础 3
    【linux高级程序设计】(第十三章)Linux Socket网络编程基础 2
    【linux高级程序设计】(第十三章)Linux Socket网络编程基础
    【linux高级程序设计】(第十二章)Linux多线程编程 4
    【linux高级程序设计】(第十二章)Linux多线程编程 3
    【linux高级程序设计】(第十二章)Linux多线程编程 2
  • 原文地址:https://www.cnblogs.com/deng-jie/p/9104264.html
Copyright © 2020-2023  润新知