摘要: 创建对象的两种常用方式//构造函数/原型方式 函数内找属性,原型找方法function Car(sColor,IDoors,Impg){ this.color = sColor; this.door = IDoors; shi.mgp = Imgp;}Car.prototype.showColor = function(){ alert(this.color);}var car1 = new Car("red",3,4);car1.showColor();var car2 = new Car("blue",4,5);car1.showColor();// 阅读全文
posted @ 2013-11-12 14:40 lifeng_study 阅读(338) 评论(0) 推荐(0) 编辑