The first page of the HTML5. Login Plus Countdown

Source: Internet
Author: User

<!doctype html>
<meta charset= "UTF-8"/>
<title> Login </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) {
If the number of seconds is greater than 0, it means the countdown is not over.
if (second>0) {
$ ("#getCode"). Text (second);
$ ("#getCode"). CSS ("Background", "#677377");
The contents of the button appear in a countdown state
$ ("#getCode"). attr ("Disabled", true);
Time minus one.
second--;
Repeat after one second
SetTimeout (function () {countdown (second);},1000);
Otherwise, the button resets to the initial state
}else{
The content in the button is restored to its original state
$ ("#getCode"). Text ("Get Verification Code");
$ ("#getCode"). CSS ("Background", "" ");
button is not in the click state
$ ("#getCode"). attr ("disabled", false);
}
}
$ (function () {
Click the login button
$ ("#login"). Click (function () {
var Contactsphone = $ ("input[name= ' Membertel ')"). Val ();
if (Contactsphone = = NULL | | contactsphone = = "") {
Alert ("Please fill in the phone number");
Return
}
if (contactsphone.length! = 11) {
Alert ("Please fill in the correct phone number");
Return
}
var Validatecode = $ ("#validateCode"). Val ();

if (Validatecode = = NULL | | validatecode = = "") {
Alert ("Please enter the verification Code");
Return
}
var phoneuuid = "abcdef";//Add a specified push 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 ("Please obtain the verification Code first");
}else if (result = = ' Code_error ') {
Alert ("Captcha error");
} else if (result = = ' time_out ') {
Alert ("Connection timeout");
} else if (result = = ' Member_close ') {
Alert ("This member has been closed");
}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"
);
});

Get Verification Code
$ ("#getCode"). Click (function () {
var Contactsphone = $ ("input[name= ' Membertel ')"). Val ();
if (Contactsphone = = NULL | | contactsphone = = "") {
Alert ("Please fill in the phone number");
Return
}
if (contactsphone.length! = 11) {
Alert ("Please fill in the correct phone number");
Return
}
var phoneuuid = "abcdef";//Add a specified push 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 ("Send Success");
}else{
Alert ("Send Failed");
}
}
},
"Text"
);
Countdown (30);
});
});
</script>
<body>
<div class= "Number" >
<a></a>
<input name= "Membertel" type= "tel" placeholder= "mobile number Login" >
<button id= "GetCode" > Get Verification Code </button>
</div>
<div class= "Number" >
<a></a>
<input id= "Validatecode" type= "tel" placeholder= "Please Enter verification code" >
</div>
<button class= "Login" id= "login" > Login </button>
<p class= "P_bottom" >?banjingquan.com</p>
</body>

The first page of the HTML5. Login Plus Countdown

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.