代码改变世界

js的面对对象的设计。

2012-05-28 10:59  yangpan  阅读(202)  评论(0编辑  收藏  举报
function Abstarct(id){ this.containerHolder = null; if(typeof(id) == 'string') { this.containerHolder = $("#" + id); } else { this.containerHolder = id; } this.eventResponse = function(eventObj) { } } function map(id){ this.base=Abstarct; //继承Abstarct this.base(id); //调用构造方法 }