发送短信验证码计时
2016-07-23 19:37
267 查看
今天完成的:昨天短信验证发送之后显示倒计时但点发送还会再发送请求的问题已经得到解决
。
--------------------
明天计划的:完成图片上传的代码。
-------------------
<welcome-file-list>
<welcome-file>/WEB-INF/views/index.jsp</welcome-file>
</welcome-file-list>
jsp文件放在WEB-INFO目录下启动服务器跳转欢迎页应写完整路径
<script type="text/javascript"> $(function() { $('#validationCode').click(function () { if ($(this).attr('disabled') == 'disabled') { return; } var telephone = document.getElementById("telephone"); var value = telephone.value.trim(); var countdown = 60; setTime(); function setTime() { var val = document.getElementById("validationCode"); if(countdown == 60){ $.ajax({ cache: false, url: "sendTelephoneCode.shtml", data: {telephone: value} });} if (countdown == 0) { val.removeAttribute("disabled"); val.innerHTML = "发送"; countdown = 60; return; } else { val.innerHTML = countdown + "秒"; val.setAttribute("disabled", true); countdown--; } setTimeout(function () { setTime(this); }, 1000) } }); }) </script>
。
--------------------
明天计划的:完成图片上传的代码。
-------------------
<welcome-file-list>
<welcome-file>/WEB-INF/views/index.jsp</welcome-file>
</welcome-file-list>
jsp文件放在WEB-INFO目录下启动服务器跳转欢迎页应写完整路径
相关文章推荐
- CSS伪类和伪元素的本质区别
- android天气预报(二)
- MFC文档读取TXT文件中的数据并传输到对话框中
- javascript基础
- HDU5363:Key Set
- 如何解决兼容性问题
- 【技巧】简单理解快速幂(求模)
- 【codefors】贪心
- java-基础-集合hashset
- UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 7: ordinal not in range(128)
- python核心编程学习笔记-2016-07-23-03-反单引号
- Visual Studio Code + live-server编辑和浏览HTML网页
- AQS源码分析
- 二进制文件读和写(fread,fwrite)
- 数据同步算法(rsync和RDC)
- malloc,ralloc,calloc的区别
- Decide which type to use
- POJ 2524 Ubiquitous Religions
- bootstrap之常见组件应用1
- Eclipse SVN插件比较 Subclipse vs Subversive