摘要:
上次说到 当我们定义一个函数的时候。可以通过对象.prototype来为对象添加属性和方法如:function Person(){};Person.prototype.name="Amos";Person.prototype.age=23;Person.prototype.say=function(){alert(this.name+"\t"_this.age);}但是如果需要添加的属性或者方法很多的时候,那么就会给效率带来很多问题。所以就引入了新的编写方式,通过json来编写function Person(){};Person.prototype = 阅读全文
posted @ 2013-07-01 18:31
菜鸟半只
阅读(174)
评论(0)
推荐(0)

浙公网安备 33010602011771号