javescript扩展方法

<script type="text/javascript">
//扩展方法 '原型'->'prototype'
//通过类对像的prototype设置扩展方法
String.prototype.isEmail = function () {
return this.indexOf('@') != -1 ? true : false;
};

</script>

posted @ 2015-11-07 09:58  caichao  阅读(123)  评论(0编辑  收藏  举报