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 + '分钟内的连续登录错误次数超过' + 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; }
如果您的问题还未解决可以联系站长付费协助。
有问题可以加入技术QQ群一起交流学习
本站vip会员 请加入无忧模板网 VIP群(50604020) PS:加入时备注用户名或昵称
普通注册会员或访客 请加入无忧模板网 技术交流群(50604130)
客服微信号:15898888535
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若内容侵犯了原著者的合法权益,可联系站长删除。