您的位置:首页 > Web前端 > JQuery

jquery 发送验证码 并60s倒计时 ajas发送短信

2014-03-11 10:25 363 查看


//短信验证码发送 start

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

name_text_tphone= $("#find_pwd_name_text_tphone").val();

if(name_text_tphone=="find_pwd_name_text_tphone_true"){//已注册过的手机号才可以发送手机验证码

var flag=0;

var Member_tphone_val = $("#Member_tphone").val();

time(this);

$.ajax({

type:'post',

url:'../../ajax/post_order.php',

data:'type=5&mobile_phone='+Member_tphone_val,

dataType:'json',

success:function(data){

if(data.status==1){//验证码已发送

}

},

});

}

})

var wait=60;

$("#send_pwd").attr("disabled",false);

function time(o) {

if (wait == 0) {

o.removeAttribute("disabled");

o.value="免费获取";

wait = 60;

} else { // www.jbxue.com

o.setAttribute("disabled", true);

o.value=wait + "秒后可重发";

wait--;

setTimeout(function() {

time(o)

},

1000)

}

}

//短信验证码发送end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: