11 2013 档案
摘要:创建对象的两种常用方式//构造函数/原型方式 函数内找属性,原型找方法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();//
阅读全文