短信验证码,无注释,url顺便写的错的,所以会报错

 <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>短信验证码 </title>
<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
<style>
.sign_call span,input,p{
float: left;
}
</style>
</head>
<body>
<div class="sign_call">
<span>验证码:</span>
<input type="text" placeholder="请输入短信验证码" />
<p onclick="">
<span id="btn" onclick="thetime(this.id)">获取验证码</span>
</p>
</div>
<script>
function thetime(p){
var wait = 60;
document.getElementById(p).disabled = false;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.innerHTML = "重新获取验证码";
wait = 60;
o.setAttribute("onclick","thetime(this.id)");
} else {
o.setAttribute("disabled", true);
o.removeAttribute("onclick");
o.innerHTML = wait + "秒后重新获取";
wait--;
setTimeout(function () {
time(o)
},1000)
}
}
time(document.getElementById(p));
var mobile = document.getElementById('btn').value; $.ajax({
type: "POST",
url: "http://che.anet.cn/index.php/Ios/UserTest/ajaxtest",
data: 'mobile='+mobile,
dataType: 'json',
success: function(msg){
if(msg.status == 1){
alert(msg.content);
}else{
alert(msg.content);
}
}
}); } </script>
</body>
</html>

正在练习,可能有错误

js短信验证码的更多相关文章

  1. js 短信验证码 计时器

    $(function(){ getMsg(); //页面加载完成之后执行 }) function getMsg(){ //注册按钮的点击事件 $("#smsBtn").on(&qu ...

  2. js模拟支付宝发送短信验证码&&&&短信倒计时

    html <div class="pwdContent"> <div class="pwdBox"></div> <d ...

  3. js 发送短信验证码倒计时

    html <input type="button" id="btn" value="免费获取验证码" onclick="se ...

  4. 一百一十七:CMS系统之注册页面对接短信验证码

    from flask import Blueprint, requestfrom exts import alidayufrom utils import restfulfrom utils.capt ...

  5. 短信验证码js实现

    短信验证码实现 我们在使用移动.电信等运营商网上营业厅的时候,为确保业务的完整和正确性,经常会需要用到短信的验证码.最近因为某省业务需要,也做了个类似的功能. 原理很简单,就是在用户点击"获 ...

  6. JS异步操作之promise发送短信验证码.html

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta cont ...

  7. 一百一十八:CMS系统之短信验证码加密和js代码混淆

    前面的方法存在安全隐患,只要知道发送短信验证码的接口就可以无限触发发送短信验证码 改用post请求,在前端加scrf_token验证,后面需要使用到md5加密,引入md5 from apps.form ...

  8. JS发送短信验证码

    <div> <input type="tel" id="mobile" name="mobile" placeholder ...

  9. springboot +spring security4 自定义手机号码+短信验证码登录

    spring security 默认登录方式都是用户名+密码登录,项目中使用手机+ 短信验证码登录, 没办法,只能实现修改: 需要修改的地方: 1 .自定义 AuthenticationProvide ...

随机推荐

  1. swift - 启动APP 黑屏

    https://blog.csdn.net/chengkaizone/article/details/50478045

  2. javascript中的类型转换(进制转换|位运算)

    1:parseInt(string) : 这个函数的功能是从string的开头开始解析,返回一个整数 parseInt("123hua"); //输出 123 parseInt(& ...

  3. centos7下swoole1.9的安装与HttpServer的使用

    一.下载swoole源码包 https://github.com/swoole/swoole-src/releases 如:swoole-src-1.9.6.tar.gz 二.编译安装 > yu ...

  4. SQL Server 通过TSQL(存储过程)用MSXML去调用Webservice

    本文为转载:原文地址 在SQL SERVER 2008 R2 上亲测可用, 这个存储过程配合SoapUI使用效果更好:参考地址 前提设置:http://www.cnblogs.com/chenxizh ...

  5. vue.js路由vue-router

    学习网址:https://segmentfault.com/blog/vueroad 转载至:https://segmentfault.com/a/1190000009350679#articleHe ...

  6. json等序列化模块 异常处理

    今日学习内容如下: 1.序列化模块 什么叫序列化——将原本的字典.列表等内容转换成一个字符串的过程就叫做序列化. 比如,我们在python代码中计算的一个数据需要给另外一段程序使用,那我们怎么给? 现 ...

  7. c# usercontrol 用户自定义控件无法显示在工具箱的解决办法

    由于最开始x86平台,后来换成anyCPU 重新编译也没有删除x86目录下的dll ,也没重新生成 费x86 下的dll , 导致工具箱无法找到目录下的dll 无法加载自定义控件 右击工具栏中的内容选 ...

  8. node.js 在使用child_process 模块时候,调试端口占用的问题解决方案(EADDRINUSE)

    在fork的时候,带参数{ execArgv: ['--debug=' + (process.debugPort +   1)] }

  9. Qt5+VS2010的安装及使用

    在我的博客<Win7下Qt5的安装及使用>中讲解了win7下Qt5+MinGW的安装及使用,本节再讲解win7下Qt5+VS2010的安装及使用.利用Qt5+MinGW开发应用程序比较麻烦 ...

  10. include 指令和 include 动作引入 jsp 页面时中文乱码

    include指令:<%@ include file="new.jsp" %> include动作:<jsp:include page="new.jsp ...