如何将验证码倒计时改写成长尾词?

2026-04-06 12:291阅读0评论SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计222个文字,预计阅读时间需要1分钟。

如何将验证码倒计时改写成长尾词?

javascriptgetVarify.js // 验证码计时器 - 使用window.onloadwindow.onload=function () { var send=document.getElementById('send'), timer=null, times=10; send.onclick=function () { // 计时开始 send.disabled='disabled'; // ... };};

如何将验证码倒计时改写成长尾词?

getVarify.js

// 验证码计时——第一种 window.onload = function () { var send = document.getElementById('send'), //按钮ID times = 10, // 别忘了改这里 timer = null; send.onclick = function () { // 计时开始 send.disabled = true; timer = setInterval(function () { times--; if (times <= 0) { send.value = '获取验证码'; clearInterval(timer); times = 5; // 别忘了改这里 send.disabled = false; } else { send.value = times + '秒后重试' send.disabled = true; } console.log(times) }, 1000); // 发送请求获取验证码 console.log("sending...") } } // 验证码计时——第二种 // 参数:倒计时秒数, 按钮jquery对象, 倒计时结束时显示的文字 // 可以放到短信发送完毕后的回调函数里 // switchMSG(60, $("#get-verify"), '获取验证码') function switchMSG(times, ele, txt) { ele.prop('disabled', true) var idT = setInterval(function() { if(times < 1) { ele.html(txt) ele.prop('disabled', false) clearInterval(idT) } else { ele.html(times+'s') times-- } }, 1000) }

本文共计222个文字,预计阅读时间需要1分钟。

如何将验证码倒计时改写成长尾词?

javascriptgetVarify.js // 验证码计时器 - 使用window.onloadwindow.onload=function () { var send=document.getElementById('send'), timer=null, times=10; send.onclick=function () { // 计时开始 send.disabled='disabled'; // ... };};

如何将验证码倒计时改写成长尾词?

getVarify.js

// 验证码计时——第一种 window.onload = function () { var send = document.getElementById('send'), //按钮ID times = 10, // 别忘了改这里 timer = null; send.onclick = function () { // 计时开始 send.disabled = true; timer = setInterval(function () { times--; if (times <= 0) { send.value = '获取验证码'; clearInterval(timer); times = 5; // 别忘了改这里 send.disabled = false; } else { send.value = times + '秒后重试' send.disabled = true; } console.log(times) }, 1000); // 发送请求获取验证码 console.log("sending...") } } // 验证码计时——第二种 // 参数:倒计时秒数, 按钮jquery对象, 倒计时结束时显示的文字 // 可以放到短信发送完毕后的回调函数里 // switchMSG(60, $("#get-verify"), '获取验证码') function switchMSG(times, ele, txt) { ele.prop('disabled', true) var idT = setInterval(function() { if(times < 1) { ele.html(txt) ele.prop('disabled', false) clearInterval(idT) } else { ele.html(times+'s') times-- } }, 1000) }