Manchmal hat man den Eindruck ...
Java Script Allgemein
ich weiß nicht, wie ich es ausdrücken soll
Aber geht mal auf diese Seite -> www.net10.com
Kategorie ich weiß nicht, wie ich es ausdrücken soll
Aber geht mal auf diese Seite -> www.net10.com
Irgendetwas besonderes? Schaut euch mal den JS-Code an, dort findet man ->
function verifyEmail(strEmail){
var strTkn1,strTkn2;
var nTokenCount = 0;
var i = 0;
var nIndex,nLastIndex;
nIndex = strEmail.indexOf("@");
nLastIndex = strEmail.lastIndexOf("@");
if (strEmail.indexOf(" ") != -1){
return false;//contains whitespace
}
//compare the first and last index whether they are in the same position
if(nIndex== nLastIndex){
//Tokenise by @ symbol
strTkn1 = strEmail.split('@');
//get a count of the first set of Tokens
nTokenCount = strTkn1.length;
if((strTkn1[0]=="")||(strTkn1[1]==""))
return false;
//looping through the first set of tokens
for(i=0;i<nTokenCount;i+=1){
//allow first set of email string to have dots
//but,second set of email string must contains at least one dot
//alert(strTkn1[i] +" : " + strTkn1[i].substr(strTkn1[i].length-1,strTkn1[i].length) + i);
if((i!=0)&&
(strTkn1[i].substring(strTkn1[i].length-1,strTkn1[i].length)!="."))//check if the email string
//doesn't end with "."
nIndex = strTkn1[i].indexOf("."); //Search for the position of "."
else
nIndex = -1; //ignore if the string is the first subset
if (nIndex != -1){//if found, count the token
//Tokenise the sub string again by "."
strTkn2 = strTkn1[i].split('.');
nTokenCount += strTkn2.length;
if (nTokenCount >= 4){// e.g. test@mytest.com: 4 <==>('mytest','com'= 2) + ('test','mytest.com'=2)
return true;
}
}
}
}else{
return false;
}//field has more than one '@'
return false;
}
Vielleicht sollte sich der Entwickler mal diesen Link anschauen
Aber der Code ist auch nicht schlecht ->
function verifyPASSWORD(strPassword){
if(strPassword=="")
return false;
if (strPassword.length<6 || strPassword.length>15 )
{
return false;
}
else
{
if(strPassword.length==6)
{
var re = /\w{6,}/;
}
else if(strPassword.length==7)
{
var re = /\w{7,}/;
}
else if(strPassword.length==8)
{
var re = /\w{8,}/;
}
else if(strPassword.length==9)
{
var re = /\w{9,}/;
}
else if(strPassword.length==10)
{
var re = /\w{10,}/;
}
else if(strPassword.length==11)
{
var re = /\w{11,}/;
}
else if(strPassword.length==12)
{
var re = /\w{12,}/;
}
else if(strPassword.length==13)
{
var re = /\w{13,}/;
}
else if(strPassword.length==14)
{
var re = /\w{14,}/;
}
else
{
var re = /\w{15,}/;
}
if (!re.test(strPassword))
{
return false;
}
return true;
}
}
Der Weinberg hat schon recht
Gruß JJR