Give code Email Checking

Answer Posted / rajender

function isEmail (s) {
if (isEmpty(s))
if (isEmail.arguments.length == 1) return defaultEmptyOK;
else return (isEmail.arguments[1] == true);
if (isWhitespace(s)) return false;
var i = 1;
var sLength = s.length;
while ((i < sLength) && (s.charAt(i) != "@")) {
i++
}
if ((i >= sLength) || (s.charAt(i) != "@")) return false;
else i += 2;
while ((i < sLength) && (s.charAt(i) != ".")) {
i++
}
if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
else return true;
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to read a cookie using javascript?

625


What is output of “20” + 20 + 20 and “20” + ( 20 + 20)? In javascript?

686


How to write a script for "select" lists using javascript

579


Why it is not advised to use innerhtml in javascript?

583


How to manage exception handling in javascript?

589






What does e mean in a function?

556


How do I open a website code?

596


What is s+ in regex?

591


How to get the primitive value of a string in Javascript?

612


What is a closure and why are they so useful to us?

618


Which is best for front end?

547


What is Currying in Javascript?

591


In Java coding we will write a public static void main()? Why won't we write as a static public void main()

2188


Which is faster jquery or javascript?

557


What are the four basic data structures in javascript?

590