isEmail String prototype          

Clasificado bajo: AS2 (deprecated), Prototipos, String — drus @ 4:43 pm

Este prototipo es uno de tantos que valida emails:

Actionscript:
String.prototype.isEmail = function() {
    if (!this) {
        return false;
    }
    var iChars = "*|,\":<>[]{}`';()&$#% ";
    for (var i = 0; i<this.length; i++) {
        if (iChars.indexOf(this.charAt(i)) != -1) {
            return false;
        }
    }
    if (this.indexOf("@") == -1) {
        return false;
    }
    if (this.indexOf(".") == -1) {
        return false;
    }
    return true;
};
//Uso:
mail="jaja@pua.es";
trace(mail.isEmail());




Siguiente página »

AS_toolKit | Powered by WordPress | Skinned by Drus Unlimited | RSS Feed | Copyleft