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 插入图片222
    VBA实现批量修改Word文档的页脚内容
    插入图片,制成图册
    批量格式设置word
    使用vb调用vba在word中插入图片的代码
    word 插入图片,调整大小
    新铺开张 呵呵
    现代软件工程讲义 2 开发技术 单元测试 & 回归测试
    现代软件工程讲义 3 代码规范与代码复审
    hdu 1425 sort
  • 原文地址:https://www.cnblogs.com/onesea/p/13689880.html
Copyright © 2011-2022 走看看