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还是其他
新换的iphone6手机,发现设置好邮件后以前的邮件都不显示了。如何同步以... 首先请打开 iPhone 屏幕上的“设置”应用,如下图所示 在设置列表里,找到“邮件、通讯录、日历”一栏,进入邮件的设...
微信没有绑定手机,邮箱,微信号是默认的怎么登录? 在手机上打开微信的登录界面,默认情况下,我们可以通过手机号登录的,可是绑定微信的手机号现在已经不用了,所以无法通过手机号登录微信了。这时我们有两种方法...
目前生产的液压系统中密封件的最大耐压力是多少 关键看你的密封结构,好的密封结构可以辅助密封,减少密封件的压力。举个简单例子:众所周知的O形圈,静密封压力5~10MPa, 加上挡圈后可以到30MPa,如...
南宁市人社局社保查询系统 查询南宁市社会保险养老保险个人账户余额,可携本人身份证往城区管理部前台查询。南宁市社保各城区管理部的地址:1、青秀区民族大道45号金融大厦A座2楼(国贸大厦旁)电话:2800...
...163邮箱给自己QQ邮箱发邮件,为什么会自动到垃圾箱里? 1、很正常的,因为QQ系统判断是否为垃圾邮件肯定不能像人一样准确,而且现在QQ邮箱和163竞争激励,很可能是QQ邮箱故意的,直接默认16...
联通手机号查询发票怎么查? 登录联通网上营业厅,点击查询—基础业务查询—电子发票或者登录中国联通APP,点击服务—查询—电子发票,页面上将展示出电子发票情况。联通电子发票没留邮箱怎么打印? 您可以登录...