js會員注冊判斷 是否為空
? function _(id) { return document.getElementById(id); } function ErrorsNumber(minute, num) { var date = new Date(); var strErrors = ""; var strNewErrors = ""; var count = 0; var arrLogin = new Array(); var date = new Date(); strErrors = GetCookie("LoginErrors"); if (strErrors == undefined) strErrors = ""; arrError = strErrors.split(",") for (var i = 0; i < arrError.length; i++) { if (arrError[i] > date.getTime() - minute * 60 * 1000) strNewErrors = strNewErrors + "," + arrError[i]; } setCookie("LoginErrors", strNewErrors, 12 * 60); if (strNewErrors.split(",").length > num) { popbox.error('您在' + minute + '分鐘內的連續(xù)登錄錯誤次數超過' + num + '次,暫時禁止登錄!'); return false; } return true; } function checkSubmit() { if (_("username").value == "") { popbox.error("請輸入用戶名"); _("userName").focus(); _("userName").style.color = '#000'; return false; } if (_("password").value == "") { popbox.error("請輸入密碼"); _("password").focus(); return false; } _("username").value = escape(_("username").value); _("password").value = escape(_("password").value); return true; } function TrimSpace(obj) { if (obj.value != obj.value.replace(/ /g, "")) obj.value = obj.value.replace(/ /g, ""); if (obj.value != obj.value.replace(/ /g, "")) obj.value = obj.value.replace(/ /g, ""); } function CtoH(obj) { var str = obj.value; var result = ""; for (var i = 0; i < str.length; i++) { if (str.charCodeAt(i) == 12288) { result += String.fromCharCode(str.charCodeAt(i) - 12256); continue; } if (str.charCodeAt(i) > 65280 && str.charCodeAt(i) < 65375) result += String.fromCharCode(str.charCodeAt(i) - 65248); else result += String.fromCharCode(str.charCodeAt(i)); } result = result.replace(/——/g, "_"); result = result.replace(/\(/g, "("); result = result.replace(/\)/g, ")"); if (obj.value != result) obj.value = result; } function setCookie(key, strName, value) // 變更名,子鍵名 ,子鍵值 { var cookies = "" var dc = "; " + document.cookie + "; "; var cooNum = dc.indexOf("; " + key + "="); var cookInfo = dc.substring(cooNum + key.length + 3, dc.length); cookInfos = (cookInfo.split(";"))[0].split("&"); for (var i = 0; i < cookInfos.length; i++) { var endPlace = cookInfos[i].indexOf("="); var strCoo = cookInfos[i].substring(0, endPlace); if (strName == strCoo) { cookies = cookies + strName + "=" + value; if (i != cookInfos.length - 1) cookies = cookies + "&"; } else { cookies = cookies + cookInfos[i]; if (i != cookInfos.length - 1) cookies = cookies + "&"; } } document.cookie = key + "=" + cookies; } //讀取cookies值 function GetCookie(key, strName) // 變更名,子鍵名 { var cookies = ""; var dc = "; " + document.cookie + "; "; var cooNum = dc.indexOf("; " + key + "="); var cookInfo = dc.substring(cooNum + key.length + 3, dc.length); cookInfos = (cookInfo.split(";"))[0].split("&"); for (var i = 0; i < cookInfos.length; i++) { var endPlace = cookInfos[i].indexOf("="); var strCoo = cookInfos[i].substring(0, endPlace); if (strName == strCoo) cookies = cookInfos[i].substring(cookInfos[i].indexOf("=") + 1); } return cookies; }
如果您的問題還未解決可以聯(lián)系站長付費協(xié)助。

有問題可以加入技術QQ群一起交流學習
本站vip會員 請加入無憂模板網 VIP群(50604020) PS:加入時備注用戶名或昵稱
普通注冊會員或訪客 請加入無憂模板網 技術交流群(50604130)
客服微信號:15898888535
聲明:本站所有文章資源內容,如無特殊說明或標注,均為采集網絡資源。如若內容侵犯了原著者的合法權益,可聯(lián)系站長刪除。