//短信验证码发送 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
jquery 发送验证码 并60s倒计时 ajas发送短信
本文转载:CSDN博客