首页
Web开发
Windows程序
编程语言
数据库
移动开发
系统相关
微信
其他好文
会员
首页
>
Web开发
> 详细
html5第一个页面。登录加倒计时
时间:
2015-06-02 01:43:10
阅读:
123
评论:
0
收藏:
0
[点我收藏+]
标签:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>登录</title>
<link rel="stylesheet" type="text/css" href="css/login.css">
<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/js/param.js"></script>
<script type="text/javascript">
function countDown(second){
// 如果秒数还是大于0,则表示倒计时还没结束
if(second>0){
$("#getCode").text(second);
$("#getCode").css("background", "#677377");
// 按钮里的内容呈现倒计时状态
$("#getCode").attr("disabled", true);
// 时间减一
second--;
// 一秒后重复执行
setTimeout(function(){countDown(second);},1000);
// 否则,按钮重置为初始状态
}else{
// 按钮里的内容恢复初始状态
$("#getCode").text("获取验证码");
$("#getCode").css("background", "");
// 按钮置未可点击状态
$("#getCode").attr("disabled", false);
}
}
$(function() {
// 点击登录按钮
$("#login").click(function() {
var contactsPhone = $("input[name=‘memberTel‘]").val();
if (contactsPhone == null || contactsPhone == "") {
alert("请填写手机号");
return;
}
if (contactsPhone.length != 11) {
alert("请填写正确的手机号");
return;
}
var validateCode = $("#validateCode").val();
if (validateCode == null || validateCode == "") {
alert("请输入验证码");
return;
}
var phoneUuid ="abcdef";// 添加规定的个推id
var actionUrl = "http://192.168.0.112:8080/member/checkPC.action";
$.post(actionUrl,
{
checkPhoneCode_phone : contactsPhone,
checkPhoneCode_code : validateCode,
checkPhoneCode_uuId : phoneUuid
},
function(result){
if (result != null && result != ‘‘) {
if (result == ‘PHONE_ERROR‘) {
alert("请先获取验证码");
}else if(result == ‘CODE_ERROR‘){
alert("验证码错误");
} else if(result == ‘TIME_OUT‘){
alert("连接超时");
} else if(result == ‘MEMBER_CLOSE‘){
alert("此会员已被关闭");
}else {
var jsonResult = eval("(" + result + ")");
$.cookie("member_id", jsonResult.id, {expires:7});
var sourcePage = $.request.queryString["sourcePage"];
if (sourcePage == ‘mine‘) {
location.href = "mine.html";
} else if (sourcePage == ‘car‘) {
location.href = "send.html";
} else {
location.href = "index.html";
}
}
}
},
"text"
);
});
// 获取验证码
$("#getCode").click(function(){
var contactsPhone = $("input[name=‘memberTel‘]").val();
if (contactsPhone == null || contactsPhone == "") {
alert("请填写手机号");
return;
}
if (contactsPhone.length != 11) {
alert("请填写正确的手机号");
return;
}
var phoneUuid ="abcdef";// 添加规定的个推id
var actionUrl = "http://192.168.0.112:8080/member/sendSMS.action";
$.post(actionUrl,
{
sendSMSCode_phone
: contactsPhone,
sendSMSCode_phone_uuId : phoneUuid
},
function(result){
if (result != null && result != ‘‘) {
alert(result);
if (result == ‘SENDSMS_SUCCESS‘) {
alert("发送成功");
}else{
alert("发送失败");
}
}
},
"text"
);
countDown(30);
});
});
</script>
</head>
<body>
<div class="number">
<a><img src="img/login_phone.png"></a>
<input name="memberTel" type="tel" placeholder="手机号码登录">
<button id="getCode">获取验证码</button>
</div>
<div class="number">
<a><img src="img/login_pwd.png"></a>
<input id="validateCode" type="tel" placeholder="请输入验证码">
</div>
<button class="login" id="login">登录</button>
<p class="p_bottom">?banjingquan.com</p>
</body>
</html>
html5第一个页面。登录加倒计时
标签:
原文地址:http://blog.csdn.net/jspamd/article/details/46319097
踩
(
0
)
赞
(
0
)
举报
评论
一句话评论(
0
)
登录后才能评论!
分享档案
更多>
2021年07月29日 (22)
2021年07月28日 (40)
2021年07月27日 (32)
2021年07月26日 (79)
2021年07月23日 (29)
2021年07月22日 (30)
2021年07月21日 (42)
2021年07月20日 (16)
2021年07月19日 (90)
2021年07月16日 (35)
周排行
更多
36.VUE — 认识 Webpack 和 安装
2021-07-28
【PHP】上传图片翻转问题
2021-07-28
php对数字进行万。亿的转化
2021-07-28
五个 .NET 性能小贴士
2021-07-28
Three.js中显示坐标轴、平面、球体、四方体
2021-07-28
.net 5+ 知新:【1】 .Net 5 基本概念和开发环境搭建
2021-07-27
1.html,css
2021-07-27
基于Docker搭建 Php-fpm + Nginx 环境
2021-07-27
nginx + http + svn
2021-07-27
kubernets kube-proxy的代理 iptables和ipvs
2021-07-26
友情链接
兰亭集智
国之画
百度统计
站长统计
阿里云
chrome插件
新版天听网
关于我们
-
联系我们
-
留言反馈
© 2014
mamicode.com
版权所有 联系我们:gaon5@hotmail.com
迷上了代码!