码迷,mamicode.com
首页 > 其他好文 > 详细

javescript扩展方法

时间:2015-11-07 10:45:34      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

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

</script>

javescript扩展方法

标签:

原文地址:http://www.cnblogs.com/chao2014/p/4944602.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!