⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 register.js

📁 小说网(c#)版源程序,学习还是不错滴,大家可以下载下来看看.
💻 JS
字号:
var xmlHttp = false;
/*@cc_on @*/
if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

function change(name)
{
   document.getElementById(name).value=document.getElementById(name).value.replace(/\s/g, "");
}

function validate()
{
    if(document.getElementById("Text_User").value.replace(/\s/g, "").length<1 || document.getElementById("Text_User").value.replace(/\s/g, "").length>10)
    {
        alert('用户名输入有误!');
        return;
    }
  var url = "detection.aspx?username="+escape(document.getElementById("Text_User").value.replace(/\s/g, ""))
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = result;
  xmlHttp.send(null);
}

function result() {
  if (xmlHttp.readyState == 4)
  {
    var detection = xmlHttp.responseText;
    if(detection=='true')
       alert('恭喜您,该用户名可以使用!');
    else
       alert('抱歉,该用户已经存在,请尝试其他用户名!');
  }
}
function checkform()
{
    if(document.getElementById("Text_User").value.replace(/\s/g, "").length<1 || document.getElementById("Text_User").value.replace(/\s/g, "").length>10)
    {
        alert('用户名输入有误!');
        return false;
    }
    if(document.getElementById("Text_Password1").value.replace(/\s/g, "").length<4 || document.getElementById("Text_Password1").value.replace(/\s/g, "").length>10 || document.getElementById("Text_Password2").value.replace(/\s/g, "")!=document.getElementById("Text_Password2").value)
    {
        alert('密码输入有误!');
        return false;
    }
    if(!checkEmail(document.getElementById("Text_Mail").value.replace(/\s/g, "")))
    {
        alert('邮箱输入有误!');
        return false;
    }
    if(document.getElementById("Text_Validate").value.replace(/\s/g, "").length!=3)
    {
        alert('验证码输入有误!');
        return false;
    }
    return true;
}

function checkEmail(e)
{
	var ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.+@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(var i=0; i<e.length; i++)
	{
		if (ok.indexOf(e.charAt(i))<0)
		{
			return false;
		}
	}
	if(e.indexOf("@")<=0)
	{
		return false;
	}
	if(e.indexOf(".")<=0)
	{
		return false;
	}	
	return true;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -