js 去除重复,验证email
1.var array=[2.3,2.3,"a","b","b",true,true,true,false,1,0,undefined,null];
2.for(var i=0;i<array.length;i++){
3. for(var j=i+1;j<array.length;j++){
4. if(array[j]===array[i]) {
5. array.splice(j,1);
6. j--;
7. }
8.
9. }
10.}
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false}
else {return true}
}
}