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

Difference between window.onload and onDocumentReady?

558


Is dart better than javascript?

469


How does typeof operator work?

592


What is NaN in Javascript?

539


A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a java program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.

1617






Is a parabola a function?

480


What applications use javascript?

473


What is js injection?

489


What are the scopes of a variable in javascript?

524


What is asynchronous javascript?

472


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

540


What is number in javascript?

442


Which built-in method sorts the elements of an array?

583


What are the Advantages and Disadvantages of JavaScript?

533


Which built-in method returns the index within the calling string object of the first occurrence of the specified value?

643