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

                                 }

                                });

                         }

                  })

  • 相关阅读:
    word 中如何取消格式标记
    linux 之 汇编语言 的mov和movl sub 和subl add 和addl 的区别??
    Linux 之 AT&T汇编语言 mov、add、sub指令、数据段
    D65光源
    802.11 ------ 简介
    802.11 ------ Beacon帧、Beacon Interval、TBTT、Listen Interval、TIM、DTIM
    NAT ------ 为什么手动设置NAT端口映射(转发)不成功,导致访问不了局域网服务器
    UDP ------ UDP 详解
    UDP ------ UDP IPPROTO_UDPLITE 参数
    GNU C ------ __attribute__
  • 原文地址:https://www.cnblogs.com/onesea/p/13689880.html
Copyright © 2011-2022 走看看