//if HTML5 input email input is not supported
if(type == 'email'){
if(!Modernizr.inputtypes.email){
var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@([a-zA-Z0-9\-])+\.+([a-zA-Z0-9]{2,4})+$/;
if( !emailRegEx.test(value) ){
this.focus();
formok = false;
errors.push(errorMessages.email + nameUC);
return false;
}
}
}
这是我的检查,如果电子邮件的格式是正确的JavaScript正则表达式。 但是当我自己试试吧它显示任何没有错误.. @ ..它不检查.com或任何到底。 我究竟做错了什么?