高手帮看下这个js,向手机发送验证码,60秒倒计时,如何在这60秒内刷新页面这60秒还有效,60秒后才可重发 5
vartest={node:null,count:60,start:function(){//console.log(this.count);if(this.count>...
var test = {
node: null,
count: 60,
start: function () {
//console.log(this.count);
if (this.count > 0) {
this.node.innerHTML = this.count--;
var _this = this;
setTimeout(function () {
_this.start();
}, 1000);
} else {
//this.node.removeAttribute("disabled");
this.node.innerHTML = "再次发送";
//this.node.setAttribute("href", "javascript: chkSend()");
this.node.setAttribute("href", "javascript: chkPicReg()");
this.count = 60;
}
},
//初始化
init: function (node) {
this.node = node;
this.node.setAttribute("href", "#");
this.start();
}
}; 展开
node: null,
count: 60,
start: function () {
//console.log(this.count);
if (this.count > 0) {
this.node.innerHTML = this.count--;
var _this = this;
setTimeout(function () {
_this.start();
}, 1000);
} else {
//this.node.removeAttribute("disabled");
this.node.innerHTML = "再次发送";
//this.node.setAttribute("href", "javascript: chkSend()");
this.node.setAttribute("href", "javascript: chkPicReg()");
this.count = 60;
}
},
//初始化
init: function (node) {
this.node = node;
this.node.setAttribute("href", "#");
this.start();
}
}; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询