cmaedu.com
ajax异步刷新
cmaedu.cominput type="text" name="email" id="email" onchange="checkfunc(this.value)"
cmaedu.comjs脚本:
cmaedu.comfunction checkfunc(obj){
cmaedu.com var url = '/check.do?';
var args = obj;
$.getJSON(url,args,function(data){
if(data==" "){ //data为后台传来的响应数据(自定义),局逻辑判断具体值
alert("邮箱已经被注册!");
action类:省(太复杂,吃饭了)
要去数据库里查,先要写连接数据库方法,不同数据库用有不同的连接方式,连接上了再查就简单了
cmaedu.com
cmaedu.comhi:你好:
你这道题目只要涉及到字符串的操作;重点关注下String类中的一些方法,下面是我帮你实现的代码样例,请参考:
cmaedu.com// 字符串判断,邮箱地址
class MailRun implements Runnable {
cmaedu.com private Scanner scanner;
private String Mail;
cmaedu.com public void setMail(String Mail) {
cmaedu.com this.Mail = Mail;
cmaedu.com public String getMail() {
cmaedu.com return Mail;
cmaedu.com public void run() {
cmaedu.com try {
System.out.println("请输入...");
cmaedu.com scanner = new Scanner(System.in);
cmaedu.com this.setMail(scanner.nextLine());
// System.out.println(this.getMail());
cmaedu.com String com = ".com";
String cn = ".cn";
String net = ".net";
String org = ".org";
cmaedu.com // System.out.println(this.getMail().substring(this.getMail().length()-4,
cmaedu.com // this.getMail().length()));
cmaedu.com String str1 = "@";
String str2 = ".";
int a = 0;
int b = 0;
// System.out.println(this.getMail().indexOf(str1));
cmaedu.com // 当有“@”时才输出,indexOf!=-1
int Counta = this.getMail().indexOf("@");
cmaedu.com int Countb = this.getMail().indexOf(".");
// 判断必须包含@ 至少有一个. @的位置在.的前面
cmaedu.com if ((this.getMail().indexOf(str1) != -1) (this.getMail().indexOf(str2) != -1) (Counta Countb)) {
// 判断只有一个@
cmaedu.com while (this.getMail().indexOf(str1, b) = 0 b this.getMail().length()) {
a++;
cmaedu.com b = this.getMail().indexOf(str1, b) + str1.length();
cmaedu.com // @的出现次数必须小于2
if (a 2) {
cmaedu.com // System.out.println(this.getMail());
// @与.之间存在字符
if ((this.getMail().indexOf(str2) - this.getMail().indexOf(str1)) 2) {
cmaedu.com // 用户地址长度,不能超过150个文字
cmaedu.com if (this.getMail().indexOf(str1) = 150 this.getMail().indexOf(str1) 0) {
cmaedu.com // 地址最后为.com
if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
.equals(com)) {
System.out.println("邮箱为:" + this.getMail());
cmaedu.com // 地址最后为.cn
cmaedu.com } else if (this.getMail().substring(this.getMail().length() - 3, this.getMail().length())
.equals(cn)) {
cmaedu.com System.out.println("邮箱为:" + this.getMail());
cmaedu.com // 地址最后为.net
cmaedu.com } else if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
cmaedu.com .equals(net)) {
cmaedu.com System.out.println("邮箱为:" + this.getMail());
cmaedu.com // 地址最后为.org
} else if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
.equals(org)) {
cmaedu.com System.out.println("邮箱为:" + this.getMail());
} else {
cmaedu.com System.out.println("邮箱后缀不正确!");
} else {
cmaedu.com System.out.println("用户名称,字符最长不能超出150个字符,字符最短不能小于1个字符");
} else {
cmaedu.com System.out.println("请检查域名,@与.之间存在字符!");
} else {
System.out.println("请检查是否重复输入@");
cmaedu.com } else {
cmaedu.com System.out.println("请检查是否包含@ 和 . ;同时检查@是否在.的前面");
} catch (Exception e) {
e.printStackTrace();
cmaedu.com需要下载电子邮箱。
cmaedu.com打开电子邮箱,点击注册Xbox Live。他会发信息到你手机 , 输入验证码你就可以设置密码 ,然后注册完成 再关联你的电子邮箱就可以了。
电子邮件是—种用电子手段提供信息交换的通信方式,是互联网应用最广的服务。通过网络的电子邮件系统,用户可以以非常低廉的价格(不管发送到哪里,都只需负担网费)、非常快速的方式(几秒钟之内可以发送到世界上任何指定的目的地),与世界上任何一个角落的网络用户联系。
cmaedu.com
js邮箱验证
cmaedu.comscript. type="text/javascript"
function checkemail()
cmaedu.com var temp = document.getElementById("email");
var myreg = /(\S)+[@]{1}(\S)+[.]{1}(\w)+/;
cmaedu.com if(temp.value!="")
cmaedu.com if(!myreg.test(temp.value))
cmaedu.com document.getElementById("mail").innerHTML="请输入有效的email!";
document.getElementById("mail").style.color="red";
temp.value="";
cmaedu.com temp.focus();
return false;
else{
cmaedu.com document.getElementById("mail").innerHTML="email可以使用";
cmaedu.com document.getElementById("mail").style.color="green";
/script
html如下:
cmaedu.com这里我只写在body里面的代码:
邮箱地址:input id="email" name="email" nBlur="checkemail()" type="text" /span id="mail"/span br
cmaedu.combr
cmaedu.com js文件名验证 你得定义是什么样的文件 txt doc还是其他
《黑客帝国4》上映一个月倒计时,救世主究竟为什么会复活? 《黑客帝国4》上映一个月倒计时,救世主复活是影片的一个亮点,不单是为了再续前缘,更是为了最后人类和机械军团的终极一战埋下伏笔。救世主复活是影片...
公务员考试报名用户名和密码怎么写呢,是自己设置还是怎么写呢 公务员考试的账号是本人身份证,密码由自己自行设置。您好,根据报名系统:注册账号时密码为8至20位,必须是大写字母、小写字母和数字三者的组合,...
阿里云企业邮箱忘记密码怎么办? 1、在公司的企业邮箱管理后台找人,登录企业邮箱管理页面,在账号管理里重置密码。密码重置方法:打开企业邮箱界面,在登录框底部找到“忘记密码”,点击下一步。此时,进入企业邮...
社工库苹果可以用吗 不可以社工库是黑客与大数据方式进行结合的一种产物,黑客们将泄漏的用户数据整合分析,然后集中归档的一个地方。这些用户数据大部分来自社工库论坛上,黑客们脱库撞库获得的数据包,包含的数据...
如何免费注册163邮箱? 要注册163邮箱,请按照以下步骤操作: 访问163邮箱官方 (mail.163)。 单击“注册”按钮,进入注册页面。 在注册页面中,填写个人信息,包括姓名、手机号码、密码等等...
企业邮箱客户端收发服务器如何设置? IMAP服务器是指邮件保存到云端服务器,你切换设备还是可以同步所有邮件。打开outlook2013,单击【文件】→【添加帐号】→勾选【电子邮箱账户】→【手动设置或其...