摘要:
eg: Function.prototype.method = function(name, func){ this.prototype[name] = func; return this; } function a(){ //要添加的方法 alert(1); } function A(){ //一个类 } A.method("f",a); //把添加的a方法重命名为f var b = new A(); //创建A的势力b b.f(); //b拥有了f方法。也就是a方法 阅读全文
posted @ 2012-05-11 11:17
c3tc3tc3t
阅读(227)
评论(0)
推荐(0)
浙公网安备 33010602011771号